code:     public static HierarchicalConfiguration loadXml(InputStream xmlStream) {
          try {
              XMLConfiguration cfg = new XMLConfiguration();
              DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
              //Disabling DTDs in order to avoid XXE xml-based attacks.
              disableFeature(dbfactory, DISALLOW_DTD_FEATURE);
              disableFeature(dbfactory, DISALLOW_EXTERNAL_DTD);
              dbfactory.setXIncludeAware(false);
              dbfactory.setExpandEntityReferences(false);
              cfg.setDocumentBuilder(dbfactory.newDocumentBuilder());
              cfg.load(xmlStream);
              return cfg;
          } catch (ConfigurationException | ParserConfigurationException e) {
              throw new IllegalArgumentException("Cannot load xml from Stream", e);
          }
      }
  
  