code: public static void addListener(Document doc, Element root) {
      Element listener = doc.createElement("listener");
      Element listenerClass = doc.createElement("listener-class");
      listener.appendChild(listenerClass);
      listenerClass.appendChild(doc
          .createTextNode("org.apache.shiro.web.env.EnvironmentLoaderListener"));
  
      addRelativeTo(root, listener, "listener", true);
    }
docs: Adds a shiro environment listener to load the shiro config file.
  @param doc The xml DOM document to create the new xml elements with.
  @param root The xml Element node to add the listener to.