@Override
    protected void setCompletion(final HTTPCompletion completion) {
        super.setCompletion(new HTTPCompletion() {
            @Override
            public void failure(URLRequest request, Throwable t) {
                if (completion != null) {
                    completion.failure(request, t);
                }
            }
            @Override
            public void success(URLRequest request, Object responseData) {
                if (completion != null) {

                    String xmlContent = new String((byte[])responseData);

                    Document document = null;
                    try {
                        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                        DocumentBuilder builder = factory.newDocumentBuilder();
                        document = builder.parse(new InputSource(new StringReader(xmlContent)));
                        document.getDocumentElement().normalize();

                        if (completion != null) {
                            completion.success(request, document);
                        }
                    } catch (Exception e) {
                        if (completion != null) {
                            completion.failure(request, e);
                        }
                    }
                }
            }
        });
    }