code: private void xjc(String xmlSchemaSource, File targetFolder, String packageName)
              throws Cob2JaxbGeneratorException {
  
          try {
              File tempXsdFile = File.createTempFile("legstar", ".xsd");
              FileUtils.writeStringToFile(tempXsdFile, xmlSchemaSource);
              
              ErrorReceiver errorReceiver = new ErrorReceiverImpl();
  
              Options options = new Options();
              options.parseArguments(new String[] { "-nv", "-npa", "-p",
                      packageName, tempXsdFile.getAbsolutePath() });
  
              Model model = ModelLoader.load(options, new JCodeModel(),
                      errorReceiver);
  
              if (model == null) {
                  throw new Cob2JaxbGeneratorException(
                          "JAXB-XJC unable to parse the schema. Error messages should have been provided");
              }
  
              if (model.generateCode(options, errorReceiver) == null) {
                  throw new Cob2JaxbGeneratorException(
                          "JAXB-XJC failed to compile a schema");
              }
  
              model.codeModel.build(targetFolder);
              tempXsdFile.deleteOnExit();
          } catch (IOException e) {
              throw new Cob2JaxbGeneratorException(e);
          } catch (BadCommandLineException e) {
              throw new Cob2JaxbGeneratorException(e);
          }
      }
docs: Invoke the XJC utility which takes input from a file.
  <p/>
  First step is to copy the XSD source to a temporary file.
  <p/>
  We then build a command line and invoke XJC.
  
  @param xmlSchemaSource the input XML schema
  @param targetFolder the target folder for generated JAXB classes
  @param packageName the package name for the JAXB classes
  @throws Cob2JaxbGeneratorException