private static void Createtree (TreeView treeview, String xmlfile) {xmldoc = new XmlDocument (); Xmldoc.load (xmlfile); try {numofchild = 0; TreeView.Nodes.Clear (); XmlElement rootxml = xmldoc.documentelement; TreeNode root = new TreeNode (); Root. Text = Rootxml.name; TREEVIEW.NODES.ADD (root); if (RootXml.ChildNodes.Count > 0) {foreach (XmlNode subxmlnode in Rootxml.childnodes ) {TreeNode TreeNode = new TreeNode (); TreeNode. Text = "<" + Subxmlnode.name + ">"; Root. Nodes.Add (TreeNode); Addnodetotreeview (Subxmlnode.childnodes, TreeNode); }} else {root. Text = Rootxml.value; } } catch (Exception ex) {throw ex; }} private static void Addnodetotreeview (XmlNodeList xmlnodelist, TreeNode parentnode) { foreach (XmlNode XmlNode in XmlNodeList) {TreeNode Subtreenode = new TreeNode (); Subtreenode. Text = "<" + xmlnode. Name + ">"; PARENTNODE.NODES.ADD (Subtreenode); if (XmlNode. Childnodes.count > 0) {addnodetotreeview (xmlnode. ChildNodes, Subtreenode); } else {Subtreenode. Text = XmlNode. Value; } } }