Hi I have a class that I want to serialize to xml. The class looks like the following
[XmlRoot("clubMember")]
public class Person
{
[XmlElement("memberName")]
public string Name {get; set;}
[XmlArray("memberPoints")]
[XmlArrayItem("point")]
public List<Int32> ClubPoints {get; set;}
}
When I serialize the above class, it generates the following xml
<clubMember>
<memberName> xxxx</memberName>
<memberPoints>
<point >xx </point>
<point >xx </point>
</memberPoints>
</clubMember>
I want to generate xml like the following:
<clubMember>
<memberName> xxxx</memberName>
<memberPoints>
<point value="xx"/>
<point value="xx"/>
</memberPoints>
</clubMember>
is there a way to generate the xml mentioned above,without modifying the class structure? I really like to keep the calss structure intact, because it is used everywhere in my application.