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.
public class A
{
public List<Person> People;
}
public class Person
{
[XmlAttribute]
public string name;
}
This serializes as:
<A>
<People>
<Person name = "a"/>;
<Person name = "b"/>;
<Person name = "c"/>;
</People>
</A>
Now this seems logically correct, however the xml I am trying to replicate looks like this:
<A>
<Person name = "a"/>;
<Person name = "b"/>;
<Person name = "c"/>;
</A>
How can this be achieved?
Many thanks