First question on Stackoverflow (.Net 2.0):
So I am trying to return an XML of a List with the following:
public XmlDocument GetEntityXml()
{
so simple....
public static XElement ToXML(this IList lstToConvert, Func filter, string rootName)
{
var lstConvert = (filter == null) ? lstToConvert : lstToConvert.Where(filter);
return new XElement(rootName,
(from node in lstConvert
select new XElement(typeof(T).ToString(),
from subnode in node.GetType().GetProperties()
select new XElement(subnode.Name, subnode.GetValue(node, null)))));
}