En este post veremos como guardar un objeto c# a un archivo xml y como cargarlo. Código Serializador using System; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; namespace Datos { public static class SerializadorXML { public static object Deserializar(XmlDocument xml, Type type) { XmlSerializer s = new XmlSerializer(type); string xmlString = xml.OuterXml.ToString(); byte[] buffer = ASCIIEncoding.UTF8.GetBytes(xmlString); MemoryStream ms = new MemoryStream(buffer); XmlReader reader = new XmlTextReader(ms); object o = null; try { o = s.Deserialize(reader); } finally { reader.Close(); } return o; } public static T Deserializar (XmlDocument xml) { return (T)Deserializar(xml, typeof(T)); } ...