linq to xml query returning a list of all child elements

Posted by Xience on Stack Overflow See other posts from Stack Overflow or by Xience
Published on 2010-03-08T14:49:43Z Indexed on 2010/03/08 14:51 UTC
Read the original article Hit count: 746

Filed under:
|
|
|

I have got an xml document which looks something like this.

<Root>
<Info>....</Info>
<Info>....</Info>
<response>....</response>
<warning>....</warning>
<Info>....</Info>
</Root>

How can i write a linqToXML query so that it returns me an IEnumerable containing each child element, in this case all five child elements of , so that i could iterate over them.

The order of child elements is not definite, neither is number of times the may appear.

Thanks in advance

© Stack Overflow or respective owner

Related posts about linqtoxml

Related posts about Xml