I want to convert a complex object into XML data with one root node alone.
public class Customer
{
public Address Address { get; set; }
public User user { get; set; }
}
public class Address
{
public string city { get; set; }
public string State { get; set; }
}
public class User
{
public string Name { get; set; }
public string Id { get; set; }
public Dictionary<String, String> response { get; set; }
}
I have customer class which contain Address
and User
property. I want to convert the Customer
object into XML data with one root node.
I want the object into below XML format
<row>
<cell cellType="city">Chennai</cell>
<cell cellType="state">tamilnadu</cell>
<cell cellType="name">test</cell>
<cell cellType="id">001</cell>
<cell cellType="response1">response1</cell>
<cell cellType="response2">response2</cell>
</row>