Sub ParseTree(root As Map)
'does this contains children
If root.ContainsKey("children") Then
'get the children
Dim children As List = root.Get("children")
'loop through each child
For Each child As Map In children
'create a new record
Dim nitem As Map = CreateMap()
'get some prop
Dim tagName As String = child.GetDefault("tagName", "")
Dim parentID As String = root.GetDefault("id", "")
'update new record
nitem.Put("tagname", tagName)
nitem.Put("parent", parentID)
'does this child have attributes
If child.ContainsKey("attributes") = False Then Continue
'get the attributes
Dim attrs As Map = child.get("attributes")
For Each attr As String In attrs.Keys
Dim attrv As String = attrs.Get(attr)
nitem.Put(attr, attrv)
Next
treeSchema.Add(nitem)
ParseTree(child)
Next
End If
End Sub