xml to linq query write

stoomsessexia

New Member
I have an xDocument object and which is loaded through an xml file which contains below given data.\[code\]<note> <header>This is xml2linq -- Part1.</header> <from>From me</from> <to>to stackoverflow</to> <message>ohh wow</message></note><note> <header>This is xml2linq -- Part2 .</header> <to>to stackoverflow</to> <message>ohh wow</message></note><note> <header>This is xml2linq -- Part3 .</header> <from>From me</from> <to>to stackoverflow</to></note>\[/code\]I want to write linq query on xDocument and get the below given Output\[code\] note(header,from,to,message)\[/code\]** Description.I want the distinct list of node names which are followed by Note node. But I dont want to write a long foreach or for loop. But I want to write a simple linq query on the xDocument object.Help me to get this output...
 
Back
Top