我有一个像这样的XDocument:
XDocument outputDocument = new XDocument(
new XElement("Document",
new XElement("Stuff")
)
);
当我调用这个函数时
outputDocument.ToString()
输出为:
<Document>
<Stuff />
</Document>
但我希望它看起来像这样:
<Document>
<Stuff>
</Stuff>
</Document>
我知道第一个是正确的,但是我必须以这种方式输出它。有什么建议吗?