CSharp examples for System.Xml:XML Serialization
Serialize Object to String
using System.IO;//w w w .jav a 2 s. co m using System.Xml.Serialization; using System.Collections.Generic; using System; public class Main{ public static string Serialize<T>(T obj) { XmlSerializer<T> serializer = new XmlSerializer<T>(); return serializer.Serialize(obj); } }