code: public static Document parseXMLResponse(String xmlStr) {
          if ((xmlStr == null) || (xmlStr.length() == 0)) {
              return null;
          }
  
          // FIXME: error handling for the DOM parsing...
          try {
              DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
              return db.parse(new ByteArrayInputStream(xmlStr.getBytes()));
          } catch (ParserConfigurationException | IOException | SAXException pcex) {
              //ignore
          }
  
          return null;
      }
docs: Returns a Document(DOM) object representing the parsed XML.
  
  @param xmlStr
  @return Document