code: public static CmsModule readModuleFromManifest(byte[] manifest) throws CmsConfigurationException {
  
          // instantiate Digester and enable XML validation
          Digester digester = new Digester();
          digester.setUseContextClassLoader(true);
          digester.setValidating(false);
          digester.setRuleNamespaceURI(null);
          digester.setErrorHandler(new CmsXmlErrorHandler("manifest data"));
  
          // add this class to the Digester
          CmsModuleImportExportHandler handler = new CmsModuleImportExportHandler();
          final String[] version = new String[] {null};
          digester.push(handler);
  
          digester.addRule("*/export_version", new Rule() {
  
              @Override
              public void body(String namespace, String name, String text) throws Exception {
  
                  version[0] = text.trim();
              }
  
          });
          CmsModuleXmlHandler.addXmlDigesterRules(digester);
  
          InputStream stream = new ByteArrayInputStream(manifest);
  
          try {
              digester.parse(stream);
          } catch (IOException e) {
              CmsMessageContainer message = Messages.get().container(Messages.ERR_IO_MODULE_IMPORT_1, "manifest data");
              LOG.error(message.key(), e);
              throw new CmsConfigurationException(message, e);
          } catch (SAXException e) {
              CmsMessageContainer message = Messages.get().container(Messages.ERR_SAX_MODULE_IMPORT_1, "manifest data");
              LOG.error(message.key(), e);
              throw new CmsConfigurationException(message, e);
          }
          CmsModule importedModule = handler.getModule();
          // the digester must have set the module now
          if (importedModule == null) {
              throw new CmsConfigurationException(
                  Messages.get().container(Messages.ERR_IMPORT_MOD_ALREADY_INSTALLED_1, "manifest data"));
          } else {
              importedModule.setExportVersion(version[0]);
          }
  
          return importedModule;
      }
docs: Reads a module object from an external file source.<p>
  
  @param manifest the manifest data
  
  @return the imported module
  
  @throws CmsConfigurationException if the module could not be imported