code: public static Document getDocument(InputStream in) throws AlipayApiException {
          Document doc = null;
  
          try {
              DocumentBuilder builder = DocumentBuilderFactory.newInstance()
                      .newDocumentBuilder();
              doc = builder.parse(in);
          } catch (ParserConfigurationException e) {
              throw new AlipayApiException(e);
          } catch (SAXException e) {
              throw new AlipayApiException("XML_PARSE_ERROR", e);
          } catch (IOException e) {
              throw new AlipayApiException("XML_READ_ERROR", e);
          } finally {
              if (in != null) {
                  try {
                      in.close();
                  } catch (IOException e) {
                      // nothing to do
                  }
              }
          }
  
          return doc;
      }
docs: Parses the content of the given stream as an XML document.
  
  @param in the XML file input stream
  @return the document instance representing the entire XML document
  @throws ApiException problem parsing the XML input stream