Building an XML document

var doc =
new XDocument (
new XDeclaration ("1.0", "utf-16", "yes"),
new XElement ("test", "data")
);

string tempPath = Path.Combine (Path.GetTempPath(), "test.xml");
doc.Save (tempPath);
File.ReadAllText (tempPath).Dump();

Building an XML document

 

posted on 2012-03-27 23:43  Sanic  阅读(210)  评论(0编辑  收藏  举报

导航