// 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.Serialization; namespace E { public class Test { public static void Main(string[] args) { StreamReader sr = new StreamReader("data.xml"); XmlSerializer ser = new XmlSerializer(typeof(all)); all a = (all)ser.Deserialize(sr); foreach(allRec r in a.rec) { Console.WriteLine(r.id + " " + r.txt); } sr.Close(); } } }