title: Get XML And Entity of REST Request
body: <p>I have a Java REST webservice with a method like this:</p>
  
  <pre><code>@POST
  @Consumes(MediaType.APPLICATION_XML)
  @Produces(MediaType.TEXT_PLAIN)
  @Path("/send")
  public Response sendStuff(Stuff stuff) {
      // do magic with stuff
      return Response.ok("OK.").build();
  }
  </code></pre>
  
  <p>For debugging purposes I'd like to have the sent XML additionally to <code>Stuff</code>. </p>
  
  <p>Now I can marshal the send object manually. Then I would get an entirely different XML which might be missing a few elements or attributes.</p>
  
  <p>Or I can inject the XML and parse it myself, but that's a bit blunt and I might be missing out on webservice functionality like interceptors.</p>
  
  <p>Is there a better way to get both the XML and the Java entity from a JAX-RS webservice?</p>