// String data = Client.create().resource("http://www.discogs.com/release/" + discogsReleaseId + "?f=xml&api_key=" + API_KEY).accept(MediaType.APPLICATION_XML).header("Accept-Encoding", "gzip").header("User-Agent",USER_AGENT).get(String.class);
// Logging version
Client client = Client.create();
client.addFilter(new LoggingFilter(System.out));
WebResource webResource = client.resource("http://www.discogs.com/release/" + discogsReleaseId + "?f=xml&api_key=" + API_KEY);
String data = webResource.accept(MediaType.APPLICATION_XML).header("Accept-Encoding", "gzip").header("User-Agent",USER_AGENT).get(String.class);
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(data.getBytes()));
NodeList releases = doc.getElementsByTagName("release");
for (int i = 0; i < releases.getLength(); i++) {
Element release = (Element) releases.item(i);