First question on Stackoverflow (.Net 2.0):
So I am trying to return an XML of a List with the following:
public XmlDocument GetEntityXml()
{
There is a much easy way:
public XmlDocument GetEntityXml()
{
XmlDocument xmlDoc = new XmlDocument();
XPathNavigator nav = xmlDoc.CreateNavigator();
using (XmlWriter writer = nav.AppendChild())
{
XmlSerializer ser = new XmlSerializer(typeof(List), new XmlRootAttribute("TheRootElementName"));
ser.Serialize(writer, parameters);
}
return xmlDoc;
}