Unable to resolve class groovy.xml.XmlSlurper

hello everyone, i have a problem importing XmlSlurper. I’ll start from the beginning…
I need to extract a snapshot version of one of the dependencies from the nexus, so I use

sh 'curl -o maven-metadata.xml http://link/to/dependency/maven-metadata.xml' 
def xml = readFile('maven-metadata.xml')
def data = new XmlSlurper().parseText(xml)
def version = data.versioning.snapshotVersions.snapshotVersion.value.test()

problem is when start build I get the error

unable to resolve class groovy.xml.XmlSluper

, maybe someone knows how I can deal with it

The snippet given provides only so little information, that the lack of importing XmlSlurper could be one of the issues.

is an import groovy.xml.XmlSlurper