C# Object to XML
using System.IO;
using System.Xml
using System.Xml.Serialization;
Product data = JsonConvert.DeserializeObject<Product>(product01);
StringWriter sw = new StringWriter();
XmlTextWriter tw = null;
XmlSerializer serializer = new XmlSerializer(data.GetType());
tw = new XmlTextWriter(sw);
serializer.Serialize(tw, data);
strXML = sw.ToString();
Comments