code: public static DocumentBuilder buildSecureDocumentBuilder() throws ParserConfigurationException {
          final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
          factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
          factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
          return factory.newDocumentBuilder();
      }
docs: Constructs a new document builder with security features enabled.
  
  @return a new document builder
  @throws javax.xml.parsers.ParserConfigurationException thrown if there is a parser
  configuration exception