把Collection转化为XML

IList<string> sources = sourceFileLocation.Split(semicolonSeparater,StringSplitOptions.RemoveEmptyEntries).ToList();
XElement satFiles = new XElement("Files",from f in sources
         select new XElement("File",f));
XDocument satDoc = new XDocument(
         new XDeclaration("1.0","UTF-8","yes"),satFiles);
string satFilePath = Path.Combine(new FileInfo(Assembly.GetEntryAssembly().Location).DirectoryName,@"Files.xml");
satDoc.Save(satFilePath);

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念