// 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 UglyName { } [XmlRoot(ElementName="this-is-a-nice-name")] public class AnotherUglyName { } public class Program { public static void Main(string[] args) { (new XmlSerializer(typeof(UglyName))).Serialize(Console.Out, new UglyName()); Console.WriteLine(); (new XmlSerializer(typeof(AnotherUglyName))).Serialize(Console.Out, new AnotherUglyName()); } } }