code: @Override
      public NugetPackage parse(InputStream stream) throws NuspecParseException {
          try {
              final DocumentBuilder db = XmlUtils.buildSecureDocumentBuilder();
              final Document d = db.parse(stream);
  
              final XPath xpath = XPathFactory.newInstance().newXPath();
              final NugetPackage nuspec = new NugetPackage();
  
              if (xpath.evaluate("/package/metadata/id", d, XPathConstants.NODE) == null
                      || xpath.evaluate("/package/metadata/version", d, XPathConstants.NODE) == null
                      || xpath.evaluate("/package/metadata/authors", d, XPathConstants.NODE) == null
                      || xpath.evaluate("/package/metadata/description", d, XPathConstants.NODE) == null) {
                  throw new NuspecParseException("Invalid Nuspec format");
              }
  
              nuspec.setId(xpath.evaluate("/package/metadata/id", d));
              nuspec.setVersion(xpath.evaluate("/package/metadata/version", d));
              nuspec.setAuthors(xpath.evaluate("/package/metadata/authors", d));
              nuspec.setOwners(getOrNull((Node) xpath.evaluate("/package/metadata/owners", d, XPathConstants.NODE)));
              nuspec.setLicenseUrl(getOrNull((Node) xpath.evaluate("/package/metadata/licenseUrl", d, XPathConstants.NODE)));
              nuspec.setTitle(getOrNull((Node) xpath.evaluate("/package/metadata/title", d, XPathConstants.NODE)));
              return nuspec;
          } catch (ParserConfigurationException | SAXException | IOException | XPathExpressionException | NuspecParseException e) {
              throw new NuspecParseException("Unable to parse nuspec", e);
          }
      }
docs: Parse an input stream and return the resulting {@link NugetPackage}.
  
  @param stream the input stream to parse
  @return the populated bean
  @throws NuspecParseException when an exception occurs