Reading xml from flat file and parsing it using XmlSlurper. Here is how XML file look like
<ClientInformation>
<ContractClientVO>
<AssignmentReasonCT></AssignmentReasonCT>
<Associated></Associated>
<AuthorizedSignatureCT></AuthorizedSignatureCT>
<ClassCT></ClassCT>
<RelationshipToInsuredCT></RelationshipToInsuredCT>
<RelationshipToEmployeeCT></RelationshipToEmployeeCT>
<ClientRoleVO>
<AgentFK></AgentFK>
<Associated></Associated>
<RoleTypeCT></RoleTypeCT>
<ClientDetailVO>
<address></address>
<city></city>
<state></state>
<Amount></Amount>
</ClientDetailVO>
</ClientRoleVO>
</ContractClientVO>
</ClientInformation>
XmlSlurper reads it fine and prints the XML document. But it does not navigate XML elements.
def xml = new XmlSlurper().parseText(file)
println XmlUtil.serialize(xml) //outputs fine on console
println xml.ClientInformation.size() //outputs 0