CSharp examples for System.Xml:XML Serialization
Deserialize XML to Object
using System.Xml.Serialization; using System.Text; using System.IO;/*from w ww . j a v a 2s . c om*/ using System; public class Main{ public static T Deserialize<T>(string xml) { StringReader textReader = new StringReader(xml); XmlSerializer serializer = new XmlSerializer(typeof(T)); return (T) serializer.Deserialize(textReader); } }