title: Add unmarshalling method to JAXB generated POJOs
body: <p>I have a bunch of XSDs that i transform into POJO with the jaxb maven plugin.</p>
  
  <p>For logging purposes, i'd like to have a "unmarshal" method directly integrated inside the JAXB objects, so that i could call something like <code>generatedPOJO.toXMLString()</code>, knowing that <code>generatedPOJO</code> is the POJO generated from the XSD file via JAXB.</p>
  
  <p>I tried to look in the <a href="https://docs.oracle.com/javase/tutorial/jaxb/intro/custom.html" rel="nofollow">Custom bindings documentation</a>, but i got nothing out of that.</p>
  
  <p>Thank you for your help.</p>
  
  <p><strong>EDIT:</strong> What i want is that JAXB, in addition to generating POJOs from XSD files, adds a <code>toXMLString()</code> method to these POJOs.</p>
  
  <p>This method needs to be generated by JAXB, since i can't edit the generated POJOS. </p>