title: SoapUI - Compare XML in mock dispatch script using XMLUnit & Groovy
body: <p>In SoapUI 5.2.1 I am trying to apply assertions within my Mock Dispatch Groovy Script to compare that the XML received by the mock, matches my expected xml. I have seen references to using XMLUnit to achieve this. Does anyone have a full  groovy script including:</p>
  
  <ol>
  <li>Import of required libraries</li>
  <li>Accessing the xml payload in a format that XMLUnit can understand</li>
  <li>Creating an expected xml payload that the request payload will be compared with</li>
  <li>Comparing the xml payloads in an xml aware manner, presumably using XMLUnit</li>
  <li>Generating the assertion failures or taking some other action</li>
  </ol>
  
  <p>There are some other questions around this area, but all appear incomplete to me.</p>
  
  <p>Thanks,
  Matt.</p>