Unfortunately, you can not declare a variable in a type of itself.
So I solved the problem like this: All elements are stored globally in an array. In the element itself, for the child elements, are stored only the indices of the global array.
Just like here:
Type XML_Attribute
key as string
value as string
EndType
Type XML_Element
name As String
body As String
attributes As XML_Attribute[]
children As Integer[]
EndType
Another solution would be for children to take their own type and then declare it into the element.
Just like here:
Type XML_Attribute
key as string
value as string
EndType
Type XML_ChildElements
elements As XML_Element[]
EndType
Type XML_Element2
name As String
body As String
attributes As XML_Attribute[]
children As XML_ChildElements
EndType
I hope this inspires a little.
EDIT:
And again too slowly.