def response = """ APP CHI 1 DEN 1 """ def expected = [APP: '', CHI: '1', DEN: '1'] def xml = new XmlSlurper().parseText(response) def actual = xml.'**'.findAll{it.name() == 'Row'}.collectEntries{ [(it.'TW070_VALIDATION.CODE'.text()): it.'TW070_VALIDATION.VALID_DATA'.text() ]} println actual assert expected == actual