def expectedMap = [Key1: 'Value1', Key2: 'Value2', Key40: 'Value40']

def xmlString = """<soap:Envelope xmlns:soap="http://w...content-available-to-author-only...3.org/2003/05/soap-envelope" xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance" xmlns:xsd="http://w...content-available-to-author-only...3.org/2001/XMLSchema">
   <soap:Body>  
     <ArrayOfallObjects>
       <ArrayOfObjects>
          <Key>Key1</Key>
          <Value>Value1</Value>
       </ArrayOfObjects>
       <ArrayOfObjects>
          <Key>Key2</Key>
          <Value>Value2</Value>
       </ArrayOfObjects>
       <ArrayOfObjects>
          <Key>Key40</Key>
          <Value>Value40</Value>
       </ArrayOfObjects>
     </ArrayOfallObjects>   
   </soap:Body>
</soap:Envelope>"""

def xml = new XmlSlurper().parseText(xmlString)
def actualMap = xml.'**'.findAll {it.name() == 'ArrayOfObjects' }.collectEntries {[(it.Key.text()): it.Value.text()]}?.sort {it.key}
println "Actual data retrieved: $actualMap"
assert expectedMap == actualMap