// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using System.Xml; namespace E { class MainClass { public static void Main(string[] args) { XmlTextReader xtr = new XmlTextReader(new StreamReader(@"C:\test.xml")); while(!xtr.EOF) { if(xtr.NodeType == XmlNodeType.Element && xtr.Name == "mstns:car") { break; } else { Console.WriteLine(xtr.NodeType + " Name=" + xtr.Name + " Value=" + xtr.Value.Replace("\r\n", "")); } xtr.Read(); } } } }