using System.Xml.Serialization;
public static void Main()
BTSReceivedOn = "BTSReceivedOn_0"
var settings = new XmlWriterSettings
OmitXmlDeclaration = true,
using (var sw = new StringWriter())
using (var xr = XmlWriter.Create(sw, settings))
var serializer = new XmlSerializer(typeof(StudentInfo));
var ns = new XmlSerializerNamespaces();
ns.Add("ns0", "http://TestBizTalkMap.Student");
ns.Add("ns1", "http://TestBizTalkMap.Address");
serializer.Serialize(xr, si, ns);
[XmlRoot(Namespace = "http://TestBizTalkMap.Student")]
[XmlElement(Namespace = "")]
public Student Student { get; set; }
[XmlElement(Namespace = "http://TestBizTalkMap.Address")]
public Address Address { get; set; }
public string EnrollNo { get; set; }
public string Name { get; set; }
public string BTSReceivedOn { get; set; }
public string City { get; set; }
public string State { get; set; }