title: How to access the attribute value of soap UI response XML
body: <p>I am very new to Groovy &amp; Soap UI</p>
  
  <p>I have response XML as</p>
  
  <pre><code>&lt;carrierUDOResponse ReferenceId="" Result="SUCCESS" xmlns:xsi="" xsi:noNamespaceSchemaLocation="CarrierUDOReponse.xsd
          &lt;errors&gt;
              &lt;error code="0" description="**i WANT TO ACCESS THIS**" property=""/&gt;
          &lt;/errors&gt;
          &lt;warnings&gt;
              &lt;warning code="0" description="" property=""/&gt;
          &lt;/warnings&gt;
      &lt;/errorsAndWarnings&gt;
  &lt;/carrierUDOResponse&gt;
  </code></pre>
  
  <p>In the Groovy script I want to <strong>capture the value of attribute</strong> and pass it to next step. How should I capture?</p>
  
  <p>The groovy script is below</p>
  
  <pre><code>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
  def holder = groovyUtils.getXmlHolder( "Create_shipment#Response" )
  // loop item nodes in response message
  for( item in holder.getNodeValues( "//error.code" ))
  log.info "errors : [$item]"
  def no = holder["count(//error)"]
  </code></pre>