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 LINQ to XML 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.
You can call the
Elementsmethod to get all of the elements directly inside anXElement.For example: