in your example (once you fix the xml to be valid), the variable xml
represents the root node of the document ClientInformation
So calling:
xml.ClientInformation
Returns nothing (as ClientInformation
doesn't have a child called ClientInformation
)
To get the number of children of the root document tag, you need to just do:
println xml.size()