Hi there,

I am new to this forum so please be patient with me :-)
My problem is how to bring a nested XML structure into a single DataGridView. The XML looks like this:

    <Name>John Doe</Name>
        <Picture>Picture 10</Picture>
        <Picture>Picture 20</Picture>
        <Picture>Picture 30</Picture>
    <Name>Mike Smith</Name>
        <Picture>Picture 11</Picture>
        <Picture>Picture 21</Picture>
        <Picture>Picture 31</Picture>
        <Picture>Picture 41</Picture>
        <Picture>Picture 51</Picture>
        <Picture>Picture 61</Picture>

All I would like to do is populating a DataGridView with 4 columns (Name, Age, Language and Artwork). Each of which containing its appropriate value whereas the latter will contain all pictures... See what I mean?

Please assist.

Cheers, Tommy

__avd commented: Welcome :) Good question! +14

There are number of methods/APIs to parse XML document in .net framework but I'd like to use & suggest Linq-Xml.

Have a look at SSCCE:

Dim file = "c:\folder\data.xml"
Dim doc = XDocument.Load(file)

Dim Result = From ele In doc.Root.Descendants("Artist")
                     Select New With
                       .Name = ele.Element("Name").Value,
                       .Age = ele.Element("Age").Value,
                       .Language = ele.Element("Language").Value,
                       .Images = ele.Elements("Artwork").Select(Function(p)
                                                                 Return p.Value
                                                                End Function).ToList()}