Looks like you forgot adding correct headers to your get request (ask the REST API developer or you specific API description):
HttpURLConnection connection = (HttpURLConnection)url.openConnection();connection.header("Accept", "application/xml")connection.setRequestMethod("GET");connection.connect();
or
connection.header("Accept", "application/xml;version=1")