当然这很简单,但它现在暗指我,我想将 XDocument 的顶级节点作为 XElement 返回,但不返回它的任何后代:
寻找以下内容,但它不起作用
XElement myElement = myXDocument.Root.Element();
只想返回
<Response xmlns="someurl" xmlnsLi="thew3url">
</Response>
从
<Response xmlns="someurl" xmlnsLi="thew3url">
<ErrorCode></ErrorCode>
<Status>Success</Status>
<Result>
<Manufacturer>
<ManufacturerID>46</ManufacturerID>
<ManufacturerName>APPLE</ManufacturerName>
</Manufacturer>
</Result>
</Response>