I have the following code, which I use to traverse the XML:
private void btn_readXML_Click(object sender, EventArgs e) { var doc = new XmlDocument();
Try this:
private void btn_readXML_Click(object sender, EventArgs e) { var doc = new XmlDocument(); doc.Load("e:\\contacts.xml"); var nodes = xdoc.SelectNodes("//yournodename"); // ex. // var nodes = xdoc.SelectNodes("//Company"); TraverseNodes(nodes); }