public static string SerializeToXML
{
string serializedContext;
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(obj.GetType());
StringWriter stwOutPut = new StringWriter(new StringBuilder());
serializer.Serialize(stwOutPut, obj);
serializedContext = stwOutPut.ToString();
//Replace tag
serializedContext = serializedContext.Replace("", " ");
serializedContext = serializedContext.Replace("\r\n", " ");
return serializedContext;
}
No comments:
Post a Comment