4

我有一个 XmlDocument,我想将内容(OuterXml)作为一个漂亮的打印字符串。我怎样才能做到这一点?

问候

4

1 回答 1

2

假设我理解正确

using System.Xml.Linq;
XDocument xDoc = XDocument.Load(@".....\test.xml");
string xDocString = xDoc.ToString(SaveOptions.None);
于 2010-03-15T14:43:58.983 回答