Converts a list with a flat hierarchy (e.g. fieldnames) to a xml file.
needed namspaces:
using System.Linq;
using System.IO;
using System.Xml.Linq;
XDocument doc = new XDocument (
new XDeclaration ( "1.0", "utf8", "yes" ),
new XElement ( "Fields",
fieldList.Select ( x =>
new XElement ( "Field",
new XAttribute("name",
x.Replace ( "\"", "" )))
)));
Kommentare zum Snippet