How can I recursively read in an XML Schema(including user-defined types) with VB?

I'm re-writing a tool of ours that reads in XML Schemas, and generates XML instances of them. The original one was hard-coded to read in only certain schemas, and there are no situations with user-defined schema types like:
<xs:element name="dataPoint1" type="dataPoint" minOccurs="0"/>

The thing is, I need to re-write it to be more general, to take in any schema if possible, so the updated version will need to:

1) Read in the XSD, and save it into a node list(done).
2) Parse through the list, and trigger a flag if the current node is of a user-defined type(done).
3) Recursively go back through the list & replace the given node with the complexType information that defines it.(???)

Still relatively new to VB, and I'm having trouble coming up with the right syntax for recursive functions in VB.

Suggestions anyone? Even some examples for recursion with xml node lists would be helpful.

For Each xmlChildNode In x.childNodes(0).childNodes
strAttrValue = GetXMLNodeAttribute(xmlProjectNode, "name")
If Not strAttrValue = vbNullString Then
Set nChild = treeview1.Nodes.Add (tvwchild, n, strAttrValue) ' create a new child

' now call this function on the new node and xml node
LoadNode nChild, xmlChildNode
End If
Next xmlChildNode
End Sub

Public Function GetXMLNodeAttribute(ByVal xmlNode As IXMLDOMNode, ByVal attrName As String) As String
Dim strAttrValue As String
Dim xmlAttr As IXMLDOMAttribute

On Error GoTo errHandler
For Each xmlAttr In xmlNode.Attributes
If xmlAttr.baseName = attrName Then
GetXMLNodeAttribute = xmlAttr.Value
Exit Function
End If
Next xmlAttr

Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…