public boolean streamIndividualFactory() { ModelCompiler compiler = ModelCompilerFactory.newModelCompiler(ModelFactory.CompileTarget.XSDX); SemanticXSDModel xsdModel; xsdModel = (SemanticXSDModel) compiler.compile(model); boolean success = false; try { String classPath = getXjcDir().getPath() + File.separator + xsdModel.getDefaultPackage().replace(".", File.separator); File f = new File(classPath); if (!f.exists()) { f.mkdirs(); } FileOutputStream fos = new FileOutputStream(classPath + File.separator + "IndividualFactory.java"); success = xsdModel.streamIndividualFactory(fos); fos.flush(); fos.close(); } catch (Exception e) { e.printStackTrace(); return false; } return success; }