0
<categories>
<category text="Arts">
<category>
<category text="Design"/>
<category text="Visual Arts"/>
<category>
</category>
<category text="Business">
<category>
<category text="Business News"/>
<category text="Careers"/>
<category text="Investing"/>
</category>
</category>
<category text="Comedy"/>
</categories>
目前我使用如何選擇子節點不是子元素的整個子元素
xDoc.Descendants("category").Where(a => a.Attribute("text").Value == "Arts").Descendants("category")
上面的代碼返回我的所有類別元素的類與屬性「藝術」 我想要的只是屬於「藝術」屬性類別下的類別節點 不是具有文本屬性設計和視覺藝術的類別。我要像下
<category>
<category text="Design"/>
<category text="Visual Arts"/>
<category>