how to remove xml list name

aGreebarnita24

New Member
I'm serializing a class that has a list of subclasses. How can I exclude the collection nodes from the xml? An example will illustruat my point.\[code\]public class A{ public List<Person> People;}public class Person{ [XmlAttribute] public string name;}\[/code\]This serializes as:\[code\]<A> <People> <Person name = "a"/>; <Person name = "b"/>; <Person name = "c"/>; </People></A>\[/code\]Now this seems logically correct, however the xml I am trying to replicate looks like this:\[code\]<A> <Person name = "a"/>; <Person name = "b"/>; <Person name = "c"/>;</A>\[/code\]How can this be achieved?Many thanks
 
Back
Top