code: @Override
      public void generate(final Module module, final Element element) {
          if (!(module instanceof SimpleListExtension)) {
              return;
          }
  
          final SimpleListExtension sle = (SimpleListExtension) module;
          addNotNullElement(element, "treatAs", sle.getTreatAs());
  
          final Group[] groups = sle.getGroupFields();
          final Element listInfo = new Element("listinfo", ModuleParser.NS);
  
          for (int i = 0; groups != null && i < groups.length; i++) {
              final Element group = new Element("group", ModuleParser.NS);
  
              if (groups[i].getNamespace() != Namespace.NO_NAMESPACE) {
                  addNotNullAttribute(group, "ns", groups[i].getNamespace().getURI());
              }
  
              addNotNullAttribute(group, "element", groups[i].getElement());
              addNotNullAttribute(group, "label", groups[i].getLabel());
              listInfo.addContent(group);
          }
  
          final Sort[] sorts = sle.getSortFields();
  
          for (int i = 0; sorts != null && i < sorts.length; i++) {
              final Element sort = new Element("sort", ModuleParser.NS);
  
              if (sorts[i].getNamespace() != Namespace.NO_NAMESPACE) {
                  addNotNullAttribute(sort, "ns", sorts[i].getNamespace().getURI());
              }
  
              addNotNullAttribute(sort, "element", sorts[i].getElement());
              addNotNullAttribute(sort, "label", sorts[i].getLabel());
              addNotNullAttribute(sort, "data-type", sorts[i].getDataType());
  
              if (sorts[i].getDefaultOrder()) {
                  addNotNullAttribute(sort, "default", "true");
              }
  
              listInfo.addContent(sort);
          }
  
          if (!listInfo.getChildren().isEmpty()) {
              element.addContent(listInfo);
          }
      }
docs: Generates and injectts module metadata in a XML node (JDOM element).
  <p>
  
  @param module the module to inject into the XML node (JDOM element).
  @param element the XML node to inject the module metadata to.