title: Transfer data from XML response to SoapUI property
body: <p>I am very new to SoapUI (open source version) and REST. We have an ERP system that uses REST via web services to allow third part applications to communicate with it. I am using SoapUI to test out how these calls work. I use a user name &amp; password to get a token for my session. I've used the Property Transfer inside SoapUI to set the user name &amp; password.  The result is in XML:</p>
  
  <pre><code>&lt;MGRestTokenResponse xmlns="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
     &lt;Message&gt;success&lt;/Message&gt;
     &lt;Token&gt;--I WANT THIS DATA--&lt;/Token&gt;
  &lt;/MGRestTokenResponse&gt;
  </code></pre>
  
  <p>When I used the Property Transfer to get the token, the best I could get is to store the entire XML output. After a lot of Googling, the only solution I could come up with is in a follow up step, use the following Groovy code:</p>
  
  <pre><code>def content = context.expand('${Set Test Properties#sectoken}')
  def xml = new XmlSlurper().parseText(content)
  def token = xml.getAt("Token")
  testRunner.testCase.getTestStepByName("Set Test Properties").setPropertyValue("sectoken",token.toString())
  </code></pre>
  
  <p>Is this the correct/preferred way to extract data from an XML response in SoapUI? Should I have done anything with the text field below the "Target" settings? I assume that the process would be similar with JSON (swapping the Slurper our for Json).</p>
  
  <p>I've got a lot of testing I need to use SoapUI from &amp; I want to be sure I'm using the tool properly.</p>