title: Groovy split results
body: <p>Script:</p>
  <pre><code>import com.sap.gateway.ip.core.customdev.util.Message;
      import java.util.HashMap;
      import groovy.xml.XmlUtil;
      import groovy.xml.StreamingMarkupBuilder;
      import groovy.xml.*;
      
      def Message processData(Message message) {
      
           // get body
          def body = message.getBody(java.io.Reader);
          
          // parse xml body
          def result = new XmlSlurper().parse(body);
      
          def message1 = result.Message1;
          def message2 = result.Message2;
      
      def one = message1.EmployeeDataReplicationConfirmation.EmployeeDataReplicationConfirmation.collect { it.personId.text() }
      def two = message2.queryCompoundEmployeeResponse.CompoundEmployee.collect { it.person.person_id.text() }
      def intersect = one.intersect(two)
      def userid1 = ((one - intersect) + (two - intersect))
      println((one - intersect) + (two - intersect))
      return message;
  
  
       
  </code></pre>
  <p>Output:</p>
  <pre><code>Console Output
  Running...
  [6107, 10140, 11774]
  </code></pre>
  <p>In the text 1 and text2 fields are different ids. This command will give me IDs that are the same in both.
  But he gives them to me like this:[6107, 10140, 11774]
  But i need it in XML.. like ..
  I need this</p>
  <pre><code>&lt;Person&gt;
      &lt;User&gt;
      &lt;userid&gt;6107&lt;/userid&gt;
      &lt;/User&gt;
      &lt;User&gt;
      &lt;userid&gt;10140&lt;/userid&gt;
      &lt;/User&gt;
      &lt;User&gt;
      &lt;userid&gt;11774&lt;/userid&gt;
      &lt;/User&gt;
  </code></pre>
  <p>how can i do it ? Thanks :)
  </p>