code: Document getResourceAsDoc(String resource) throws Exception {
          ClassLoader cl = Thread.currentThread().getContextClassLoader();
          InputStream is = cl.getResourceAsStream(resource);
          if (is != null) {
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              dbf.setNamespaceAware(true);
              // Fortify Mod: prevent external entity injection
              dbf.setExpandEntityReferences(false);
              DocumentBuilder db = dbf.newDocumentBuilder();
              // Fortify Mod: prevent external entity injection 
              TransformerFactory tf = TransformerFactory.newInstance();
              tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
              Transformer t = tf.newTransformer();
              //Transformer t = TransformerFactory.newInstance().newTransformer();
  	       // End Fortify Mod
              Document doc = db.newDocument();
              t.transform(new StreamSource(is), new DOMResult(doc));
              // Fortify Mod: Close the InputStream and release its resources
              is.close();
              return doc;
          } else {
              return null;
          }
      }
docs: Loads a DOM Document from the classpath