public static PLModuleContainer createModuleContainer(List collectedmodules) {
    { PLModuleContainer container = PLModuleContainer.new_PLModuleContainer();
      List plmodules = List.newList();

      { Module module = null;
        Cons iter000 = collectedmodules.theConsList;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          module = ((Module)(iter000.value));
          { PLModule plmodule = PLModule.new_PLModule();
            edu.isi.powerloom.PlIterator childmoduleiter = edu.isi.powerloom.PLI.getChildModules(module);
            List surrogatechildren = List.newList();

            plmodule.ModuleName = module.moduleName;
            if (module.moduleCppPackage() == null) {
              plmodule.CppPackage = "";
            }
            else {
              plmodule.CppPackage = module.moduleCppPackage();
            }
            if (module.moduleLispPackage() == null) {
              plmodule.LispPackage = "";
            }
            else {
              plmodule.LispPackage = module.moduleLispPackage();
            }
            if (module.javaPackage() == null) {
              plmodule.JavaPackage = "";
            }
            else {
              plmodule.JavaPackage = module.javaPackage();
            }
            if (((StringWrapper)(KeyValueList.dynamicSlotValue(module.dynamicSlots, GuiServer.SYM_STELLA_JAVA_FLOTSAM_CLASS, Stella.NULL_STRING_WRAPPER))).wrapperValue == null) {
              plmodule.JavaCatchallClass = "";
            }
            else {
              plmodule.JavaCatchallClass = ((StringWrapper)(KeyValueList.dynamicSlotValue(module.dynamicSlots, GuiServer.SYM_STELLA_JAVA_FLOTSAM_CLASS, Stella.NULL_STRING_WRAPPER))).wrapperValue;
            }
            if (module.documentation == null) {
              plmodule.Documentation = "";
            }
            else {
              plmodule.Documentation = GuiServer.xmlifyString(module.documentation);
            }
            if (module.caseSensitiveP) {
              plmodule.CaseSensitive = "TRUE";
            }
            else {
              plmodule.CaseSensitive = "FALSE";
            }
            if (((BooleanWrapper)(KeyValueList.dynamicSlotValue(module.dynamicSlots, GuiServer.SYM_STELLA_APIp, Stella.FALSE_WRAPPER))).wrapperValue) {
              plmodule.api = "TRUE";
            }
            else {
              plmodule.api = "FALSE";
            }
            plmodule.SourceString = GuiServer.replaceChokableCharsWithEntities(GuiServer.getStringifiedModule(module));
            { Module child = null;
              edu.isi.powerloom.PlIterator iter001 = childmoduleiter;
              Cons collect000 = null;

              while (iter001.nextP()) {
                child = ((Module)(iter001.value));
                if (!GuiServer.codeModuleP(child)) {
                  if (collect000 == null) {
                    {
                      collect000 = Cons.cons(GuiServer.makeModuleSurrogate(child), Stella.NIL);
                      if (surrogatechildren.theConsList == Stella.NIL) {
                        surrogatechildren.theConsList = collect000;
                      }
                      else {
                        Cons.addConsToEndOfConsList(surrogatechildren.theConsList, collect000);
                      }
                    }
                  }
                  else {
                    {
                      collect000.rest = Cons.cons(GuiServer.makeModuleSurrogate(child), Stella.NIL);
                      collect000 = collect000.rest;
                    }
                  }
                }
              }
            }
            plmodule.PLSurrogate = surrogatechildren;
            plmodules.insert(plmodule);
          }
        }
      }
      container.PLModule = plmodules;
      return (container);
    }
  }