code: @Override
      public void initialize() {
          // initialize xpath
          XPathFactory xPathfactory = XPathFactory.newInstance();
          xPath = xPathfactory.newXPath();
          xPath.setNamespaceContext(new NamespaceContext() {
  
              @Override
              @SuppressWarnings("rawtypes")
              public Iterator getPrefixes(String namespaceURI) {
                  return null;
              }
  
              @Override
              public String getPrefix(String namespaceURI) {
                  return null;
              }
  
              @Override
              public String getNamespaceURI(String prefix) {
                  if (prefix != null) {
                      switch (prefix) {
                      case XMLConstants.DEFAULT_NS_PREFIX:
                          return "http://www.w3.org/1999/xhtml";
                      case "ui":
                          return "http://java.sun.com/jsf/facelets";
                      case "h":
                          return "http://java.sun.com/jsf/html";
                      case "f":
                          return "http://java.sun.com/jsf/core";
                      }
                  }
                  return XMLConstants.NULL_NS_URI;
              }
          });
  
          // initialize DocumentBuilder
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          factory.setNamespaceAware(true);
          factory.setValidating(false);
          try {
              factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
              factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
          } catch (ParserConfigurationException e) {
              LOGGER.warn("Cannot set features of document builder factory.", e);
          }
          try {
              documentBuilder = factory.newDocumentBuilder();
          } catch (ParserConfigurationException e) {
              throw new IllegalStateException("Cannot create document builder.", e);
          }
  
      }
docs: {@inheritDoc}