title: Unmarshalling XOP with JAXB
body: <p>I have a data source that has switched from base64 embedded image data to XOP image data. I'm using Java/JAXB to unmarshal the data and can't find any good sources describing how it's done. All references seem to describe doing this with SOAP messages which seem to take care of some of the heavy lifting for you.</p>
  
  <p>In my case, the data is coming in effectively as a string that needs to be unmarshalled into objects created by JAXB. Since the new messages start with </p>
  
  <pre><code>Mime-Version: 1.0
  Content-Type: multipart/related; start-info="text/xml"; type="application/xop+xml"; 
      start="&lt;-963165769043289641.1400077877224@xxxxxyyyyyy.ca&gt;"; 
      boundary="----=_Part_0_-338193320.1400077877317"
  </code></pre>
  
  <p>obviously it won't unmarshal the data as XML as it doesn't look like XML (no data allowed before prolog). </p>
  
  <p>Can this be done with JAXB? The creation of the object from the schema seems to work fine and creates what looks like a proper object (it creates an Include element). I've tried creating an AttachmentUnmarshaller manually but it hasn't helped ... the incoming data is still not recognized as XML. I feel like I'm missing a fundamental step but can't find any good references or examples.</p>
  
  <p>Any help would be greatly appreciated.</p>