// 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.Xml.Serialization; namespace E { public class C1 { public C2 Other { get; set; } } public class C2 { public C1 Other { get; set; } } public class Program { public static void Main(string[] args) { C1 o1 = new C1(); C2 o2 = new C2(); o1.Other = o2; o2.Other = o1; XmlSerializer ser = new XmlSerializer(typeof(C1)); ser.Serialize(Console.Out, o1); } } }