title: How to Parse javax.ws.rs.core.Response
body: <p>I am having trouble understanding how to parse javax.ws.rs.core.Response. Some people have pointed to using an InputStream, but I am not understanding how that works since the return type of response.getEntity() is of type Object. For example:</p>
  
  <pre><code>Response response = client.target(enpoint).request(MediaType.APPLICATION_XML).get();
  InputStream is = response.getEntity();
  </code></pre>
  
  <p>NetBeans complains and says I will need to cast type Object to InputStream. The response is going to consist of XML and I just want to be able to parse it with DOM. I am having trouble getting from javax.ws.rs.core.Response to anything useful.</p>
  
  <p>Any ideas?</p>