shorthand xml 的 XDocument 命令?

XDocument commands for shorthand xml?

我正在使用 Xdocument.Descendents(xnode).value.single() 来读取标准 xml 中元素的值,但它不适用于 shorthand喜欢

{节点值= "value" / } (用正方形替换卷曲)

有人知道我需要什么代码吗?还要更改值并保存 xml?

你能告诉我如何 Google 这个吗? shorthand xml 有专有名称吗?是否有关于此代码的 XDocument 库列表?还是我需要另一个 xml linq?

谢谢!

XDocument.Descendants(Xnode).Attributes(Xname).Single.Value

并更改它

XElement.Element(Xnode).Attribute(Xname).Value = "something"