Let's say I have a struct called Woah. Woah has one field to store the value of SomeChild below but also contains a List<Woah> to contain other Woah structs. The XML I am reading has the structure of:
<WoahWrapper>
<Woahs>
<WoahNode>
<SomeChild />
<SubWoahs>
<WoahNode />
</SubWoahs>
</WoahNode>
</Woahs>
</WoahWrapper>
So here I can assign SomeChild to to a struct I create in "select new" in my linq, but is there a way I can easily initialize that list in my struct and add to it all the WoahNodes that exist in SubWoahs?
var list = (from c in mapData.Root.Element("Woahs").Elements("WoahNode")
select new Woah()
{
somechild = Convert.ToInt32(c.Element("SomeChild").Value),
//If there are Woahs in SubWoahs, initialize list in struct and add each Woah SubWoahs to that list
});