code: public static void updateDomain(ZipFile inZip, ZipOutputStream outZip,
        ZipEntry jbossWeb, String domain, String context) throws Exception {
      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
      Document doc = docBuilder.parse(inZip.getInputStream(jbossWeb));
  
      Element rootNode = null;
      NodeList nodes = doc.getElementsByTagName("jboss-web");
      if (nodes.getLength() == 1) {
        rootNode = (Element) nodes.item(0);
      }
  
      if (domain != null && domain.length() > 0) {
        Element vHost = doc.createElement("virtual-host");
        removeNodesByTagName(rootNode, "virtual-host");
        vHost.appendChild(doc.createTextNode(domain));
        rootNode.appendChild(vHost);
      }
  
      if (context != null && context.length() > 0) {
        Element cRoot = doc.createElement("context-root");
        removeNodesByTagName(rootNode, "context-root");
        cRoot.appendChild(doc.createTextNode(context));
        rootNode.appendChild(cRoot);
      }
  
      storeXmlDocument(outZip, jbossWeb, doc);
    }
docs: Adds vHost and context-root mappings to a jboss-web.xml file contained withing a zip/war file.
  @param inZip The zip file that the original jboss-web.xml file is in.
  @param outZip The zip output stream to write the updated jboss-web.xml file to.
  @param jbossWeb The zip element that represents the jboss-web.xml file.
  @param domain The domain to add a vHost for.
  @param context The context to add a context-root for.
  @throws Exception