I have
string inputXml = @"<?xml version='1.0' encoding='UTF-8'?>
<Parent>
<Child>
<Child1 value='10' />
<Child2 value= '20' />
</Child>
<Child>
<Child1 value='30' />
<Child2 value='40' />
<Child3 value='50' />
</Child>
</Parent>";
Need a linq query that will fetch all teh values from the inner childs.
Output will be
Child1 : 10
Child2: 20
Child1: 30
Child2 : 40
Child3: 50
I am lost after this
XDocument source = null;
source = XDocument.Parse(inputXml);
var res = (from data in source.Descendants("Child")
select data);
Help needed
This should return list of anonymous objects with two properties:
NameandValue