code: private Source readSource(String xmlDocument, String features) throws Exception {
          if (xmlDocument.startsWith(Constants.Inputs.HTTP_PREFIX_STRING) || xmlDocument.startsWith(Constants.Inputs.HTTPS_PREFIX_STRING)) {
              URL xmlUrl = new URL(xmlDocument);
              InputStream xmlStream = xmlUrl.openStream();
              XmlUtils.parseXmlInputStream(xmlStream, features);
              return new StreamSource(xmlStream);
          } else {
              if (new File(xmlDocument).exists()) {
                  XmlUtils.parseXmlFile(xmlDocument, features);
                  return new StreamSource(new FileInputStream(xmlDocument));
              }
              XmlUtils.parseXmlString(xmlDocument, features);
              return new StreamSource(new StringReader(xmlDocument));
  
          }
      }
docs: Reads the xml content from a file, URL or string.
  
  @param xmlDocument xml document as String, path or URL
  @return the resulting xml after validation
  @throws Exception in case something went wrong