Hi I have xml string like you can see below
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Result>
- <AllItems>
- <Item attribute="123">
<SubItem subAttribute="1" />
<SubItem2 subAttribute2="2" />
</Item>
- <Item attribute="321">
<SubItem subAttribute="3" />
<SubItem2 subAttribute2="4" />
</Item>
</AllItems>
</Result>
I would like to get each item in allitems element get attribute values and add them to Enumerable class
Enumerable<Item> allitems = new Enumerable<Item>();
public class Item()
{
public string attribute{get;set;}
public string subattribute{get;set;}
public string subattribute2{get;set;}
}
How it can be done with using LINQ?