private XMLStreamReader getInputStream(Response response) throws IOException {
    try {
      // Prevent the parser from reading XMl with external entities defined
      XMLInputFactory xif = XMLInputFactory.newFactory();
      xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
      xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
      return xif.createXMLStreamReader(new ByteArrayInputStream(response.getBody()));
    } catch (XMLStreamException e) {
      throw new IOException("Failed to parse XML", e);
    }
  }
Convert the REST server's response to an XML reader.
@param response The REST server's response.
@return A reader over the parsed XML document.
@throws IOException If the document fails to parse
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/RemoteAdmin.java