public static XmlDocument PxzIndexToXml(PxzIndex index) { try { var xsSubmit = new XmlSerializer(typeof(PxzIndex)); var xmlSettings = new XmlWriterSettings(); var sww = new StringWriter(); var doc = new XmlDocument(); xmlSettings.Indent = true; xmlSettings.IndentChars = "\t"; xmlSettings.OmitXmlDeclaration = false; xsSubmit.Serialize(sww, index); doc.LoadXml(sww.ToString()); return(doc); } catch { return(null); } }
public static XmlDocument ToXml(this PxzIndex obj) { return(Serializers.PxzIndexToXml(obj)); }