code: public static Document getEventDocFromUrl(String url) throws TVRageException {
          Document doc;
          InputStream in = null;
  
          try {
              in = new ByteArrayInputStream(requestWebContent(url));
  
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              DocumentBuilder db = dbf.newDocumentBuilder();
              doc = db.parse(in);
              doc.getDocumentElement().normalize();
              return doc;
          } catch (ParserConfigurationException | SAXException | IOException ex) {
              throw new TVRageException(ApiExceptionType.MAPPING_FAILED, UNABLE_TO_PARSE, url, ex);
          } finally {
              try {
                  if (in != null) {
                      in.close();
                  }
              } catch (IOException ex) {
                  // Input Stream was already closed or null
                  LOG.trace("Stream already closed for getEventDocFromUrl", ex);
              }
          }
      }
docs: Get a DOM document from the supplied URL
  
  @param url
  @return
  @throws com.omertron.tvrageapi.TVRageException