we assume the following:
- no XML namespaces are involved
- the XML is a snippet (as it doesn’t have a root element)
For starting / more exploration you can do:
Modelling:
Details For each container:
xDoc.Root.Descendants(“container”)
Log: "Processing: Container with Num: " + item.Element("containernum").Value
Details For each info
item.Descendants(“containerinfo”)
Log:
String.Format("{0}, {1}.{2} ",info.Element("name").Value, info.Element("weight").Value, info.Element("height").Value)
It will produce the following output:
Depending on your further processing demands we can also modify / adapt e.g. with the usage of LINQ like:
When XML Namespaces are involved habe a look here: