I have an xml like the following
<DataCollection>
<Data>
<Name>John</Name>
<Age>30</Age>
</Data>
... more person
</DataCollection>
I want to create an object(or some type) collection with Name, Age as fields. One problem that I have is I don't know the structure before hand (all i know is, there will be DataCollection and Data) to create a class and then using linq to use select new. Current implementation, I am walking the XML for each Data, read the elements and create a comma seperated list.
is there a better way to do this? The purpose of the XML is to display all the data that is coming in under Data in a data grid.
Thanks,