Thanks for your reply. I had read that part of the help but shied away from it since it was the old API.
I reverted to the default code generation option and removed the T4 templates from my project.
I've added the XMLList class to my data model project and I've added the XMLList<MyType> MyTypes public property to my partial class.
I presumed the Roles argument in your example is the public IList property to be serialised so I renamed it to my public IList property.
However, the XML serialisation fails in the XMLList's IXmlSerializable.WriteXml method with a stack overflow exception when the XMLSerializer's Serialize method is called. Here's an extract of my code:
List<MyParent> parentList =
TextWriter myStreamWriter =
Type extraTypes =
XmlSerializer mySerializer =
What do you think I've done wrong?