How to select child node not the entire child elements of that child elements

scan06disk

New Member
\[code\]<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>\[/code\]Currently i am using \[code\]xDoc.Descendants("category").Where(a => a.Attribute("text").Value =http://stackoverflow.com/questions/13873212/="Arts").Descendants("category")\[/code\]the above code returns me all the category element from category with attribute "Arts"What i want is only the node of category just below the category with attribute "Arts"Not the category with text attribute design and visual arts. I want whole category node like under\[code\] <category> <category text="Design"/> <category text="Visual Arts"/> <category>\[/code\]
 
Back
Top