title: REST web service accepting a POST using Restlet - Best Practice
body: <p>I have my resource and they typical overridden method to handle POST requests.</p>
  
  <pre><code>public void acceptRepresentation(Representation rep) {
  
    if (MediaType.APPLICATION_XML.equals(rep.getMediaType())) {
        //Do stuff here
    }
    else {
        //complain!
    }
  }
  </code></pre>
  
  <p>What I want to know is the best practice to handle my packet of XML.  I see a lot of examples using a Form - but surely there is a way to work with the Representation object itself or cast it to some useful XML object???</p>
  
  <p>Any help on how you should and do parse incoming XML in your resource is much appreciated. </p>