Imports System.Xml
Imports System.Xml.Serialization
Imports System.IO
Public Class MainClass
Public Shared Sub Main()
Dim rawData As String = _
"" & _
" " & _
" Name 1 " & _
" 101 " & _
" 10 " & _
" " & _
" " & _
" Name 2 " & _
" 102 " & _
" 10 " & _
" " & _
" "
Dim xmlDoc As New XmlDocument
Dim productNodes As XmlNodeList
Dim productNode As XmlNode
Dim baseDataNodes As XmlNodeList
Dim bFirstInRow As Boolean
xmlDoc.LoadXml(rawData)
productNodes = xmlDoc.GetElementsByTagName("Product")
For Each productNode In productNodes
baseDataNodes = productNode.ChildNodes
bFirstInRow = True
For Each baseDataNode As XmlNode In baseDataNodes
If (bFirstInRow) Then
bFirstInRow = False
Else
Console.Write(", ")
End If
Console.Write(baseDataNode.Name & ": " & baseDataNode.InnerText)
Next
Next
End Sub
End Class