public Document getXml(String encoding) {
try {
InputSource source = new InputSource(getStream());
source.setEncoding(encoding);
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
builder.setEntityResolver(new NoOpEntityResolver());
return builder.parse(source);
} catch (Exception e) {
throw new RuntimeException(e);
}
}