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