Here you can find the source of parseResponse(HttpResponse response)
public static Document parseResponse(HttpResponse response) throws IOException, ParserConfigurationException, SAXException
//package com.java2s; //License from project: MIT License import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.apache.http.HttpResponse; import org.w3c.dom.Document; import org.xml.sax.SAXException; public class Main { public static Document parseResponse(HttpResponse response) throws IOException, ParserConfigurationException, SAXException { InputStream responseStream = response.getEntity().getContent(); DocumentBuilder xmlBuilder = DocumentBuilderFactory.newInstance() .newDocumentBuilder();// w w w. j a v a 2s . co m return xmlBuilder.parse(responseStream); } }