using System; using System.Collections.Generic; using System.Text; using System.Xml.Serialization; namespace XmlSerializationProject { class Program { static void Main(string[] args) { try { XmlSerializer classSerialization = new XmlSerializer(typeof(StockOrder)); XmlSerializerNamespaces serName = new XmlSerializerNamespaces(); serName.Add("reu", "http://www.reuters.com/ns/"); serName.Add("lip", "http://www.lipperweb.com/ns/"); StockOrder so = new StockOrder(); so.Symbol = "MSFT"; so.Quantity = 100; classSerialization.Serialize(Console.Out, so, serName); Console.ReadLine(); } catch (System.Exception ex) { Console.Error.WriteLine(ex.ToString()); Console.ReadLine(); } } } }