code: public static void storeXmlDocument(ZipOutputStream outZip,
        ZipEntry jbossWeb, Document doc) throws IOException,
        TransformerFactoryConfigurationError, TransformerConfigurationException,
        TransformerException {
      jbossWeb = new ZipEntry(jbossWeb.getName());
      outZip.putNextEntry(jbossWeb);
  
      TransformerFactory tFactory = TransformerFactory.newInstance();
      Transformer transformer = tFactory.newTransformer();
  
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
      
      DOMSource source = new DOMSource(doc);
      StreamResult result = new StreamResult(outZip);
      transformer.transform(source, result);
  
      outZip.closeEntry();
    }
docs: Writes a xml document to a zip file with an entry specified by the jbossWeb parameter.
  @param outZip The zip output stream to write to.
  @param jbossWeb The zip entry to add to the zip file.
  @param doc The xml DOM document to write to the zip file.
  @throws IOException
  @throws TransformerFactoryConfigurationError
  @throws TransformerConfigurationException
  @throws TransformerException