title: Print MOXy generated XML before sending the output to JAX-RS Web Service client
body: <p>How to print the XML generated by MOXy when using it on the server side to print the XML before sending the XML to the RESTful Web Service client.</p>
  
  <pre><code>   @GET
     @Path("/sma")
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Representation getRepresentation() throws Exception 
     {
          Representation rep= new Representation ();
          rep.setFirstName("first name");
          rep.setLastName("last name");
          return rep;
  
     }
  </code></pre>
  
  <p>In the above want to print the representation object XML before sending it to the Web Service client.</p>