How to get the xml value using groovy
<p>Sample XML:</p>

<pre><code>&lt;msgs&gt;
    &lt;msg&gt;
        &lt;type&gt;sense&lt;/type&gt;
        &lt;cid&gt;168&lt;/cid&gt;
        &lt;ip&gt;192.168.140.150&lt;/ip&gt;
        &lt;errs/&gt;
        &lt;id&gt;002EC0FEFF83EA97&lt;/id&gt;
        &lt;sensors&gt;
            &lt;sensor sid='002EC0FEFF8FFF27' desc='' batt='6.60' sig='-55' scount='0' rdate='15/05/2015 21:47:04' mdate='18/04/2016 08:06:25' /&gt;
            &lt;sensor sid='002EC0FEFF8FFF27' desc='' batt='6.60' sig='-55' scount='0' rdate='15/05/2015 21:47:04' mdate='18/04/2016 08:07:25' /&gt;
            &lt;sensor sid='002EC0FEFF8FFF27' desc='' batt='6.60' sig='-55' scount='0' rdate='15/05/2015 21:47:04' mdate='18/04/2016 08:08:25' /&gt;
        &lt;/sensors&gt;
    &lt;/msg&gt;
&lt;/msgs&gt;
</code></pre>

<p>I tried this: </p>

<pre><code> def alert = com.eviware.soapui.support.UISupport;
    //Define a file pointer for groovy to handle the file operations.
    def inputFile = new File("C:\\Users\\Desktop\\New.xml")
    def XMLDATA  = new XmlParser().parse(inputFile)
    if(!inputFile.exists())
    {
        //Display an alert if the file is not found.
        alert.showInfoMessage("Input File 'New.xml' not found!");   
    }
    else
    {
        //Read and parse XML file and store it into a variable
        println "ATT1 = ${XMLDATA.attribute("type")}"
        println "ATT2 = ${XMLDATA.attribute("cid")}"
        println "ATT3 = ${XMLDATA.attribute("ip")}"
        println "ATT4 = ${XMLDATA.attribute("id")}"

        log.info 
        println "ATT5 = ${XMLDATA.attribute("sensors/sensor sid")}"

    XMLDATA.sensors.each{
    println it.text()
    } 

}
</code></pre>

<p>It is not display any result, it works for the single node but when the multiple attributes are there then it is not display any results </p>