docs: public static void export(OutputStream os, List<JobDef> jobDefList, DbConn cnx) throws JqmXmlException
      {
          // Argument tests
          if (os == null)
          {
              throw new IllegalArgumentException("output stream cannot be null");
          }
          if (jobDefList == null || jobDefList.isEmpty())
          {
              throw new IllegalArgumentException("job def list cannot be null or empty");
          }
          if (cnx == null)
          {
              throw new IllegalArgumentException("database connection cannot be null");
          }
  
          Collections.sort(jobDefList, new Comparator<JobDef>()
          {
              @Override
              public int compare(JobDef o1, JobDef o2)
              {
                  return o1.getJarPath().compareTo(o2.getJarPath());
              }
          });
  
          // Create XML document
          Element root = new Element("jqm");
          Document document = new Document(root);
  
          Element jobDefinitions = null;
          String currentJarPath = null;
          Set<Cl> cls = new HashSet<>();
  
          for (JobDef j : jobDefList)
          {
              if (currentJarPath == null || !j.getJarPath().equals(currentJarPath))
              {
                  currentJarPath = j.getJarPath();
                  Element jar = new Element("jar");
                  addTextElementToParentElement(jar, "path", currentJarPath);
                  addTextElementToParentElement(jar, "pathType", j.getPathType().toString());
                  jobDefinitions = new Element("jobdefinitions");
                  jar.addContent(jobDefinitions);
                  root.addContent(jar);
              }
              Element jobDefinition = getJobDefinitionElement(j, cnx);
              jobDefinitions.addContent(jobDefinition);
  
              if (j.getClassLoader(cnx) != null)
              {
                  cls.add(j.getClassLoader());
              }
          }
  
          for (Cl cl : cls)
          {
              root.addContent(getClElement(cl));
          }
  
          // Done: output XML to stream.
          try
          {
              XMLOutputter out = new XMLOutputter(Format.getPrettyFormat());
              out.output(document, os);
          }
          catch (java.io.IOException e)
          {
              throw new JqmXmlException("Could not output XML to stream", e);
          }
      }