If you just need something simple, try this. Note that this version doesn't
handle characters that must be escaped in XML, and it doesn't add the XML
header to the StringBuilder you're passing (you can append that before
calling the method, if you want it), but it should put you on the right
track. Pass it the TreeNode's root node (someTreeView.Nodes(0)) to save the
whole tree, or any branch node to save that branch.
Private Sub SaveAsXML(ByVal aTreeNode As TreeNode, ByVal sb As
StringBuilder)
sb.Append("<node><text>" & aTreeNode.Text & "</text>")
For Each tn As TreeNode In aTreeNode.Nodes
SaveAsXML(tn, sb)
Next
sb.Append("</node>")
End Sub
"Tiraman :-)" <ti*****@netvision.net.il> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
Hi,
i would like to save the treeview data (nodes) into an xml file.
how should i do that ?
Thanks.