using System; using System.Text; using System.IO; using System.Xml; namespace ChildNodeTest { public class xmlrpctest { public static void Main(String []args ) { Stream testSR = File.OpenRead( "test.xml" ); XmlTextReader tr = new XmlTextReader( testSR ); XmlDocument xdoc = new XmlDocument(); xdoc.Load( tr ); XmlNode node = xdoc.FirstChild; int nodeCount = node.ChildNodes.Count; int i = 0; int nodes = node.ChildNodes.Count; Console.WriteLine( "Data node count: {0}", nodes ); foreach (XmlNode vNode in node.ChildNodes) { Console.WriteLine( "Process node {0}", i++ ); } if( nodes != i ) { Console.WriteLine( "Failure ! Itterated through {0} of {1} nodes", i, nodes ); } } } }