code: public void init(
              Document iddDoc,
              Document extensionDoc,
              final String service,
              String packageName,
              final String basedir,
              final String genSrcDir,
              final Log log,
              final String outputDir,
              boolean client,
              boolean server)
              throws Exception {
  
          try {
              output = new File(basedir, genSrcDir);
              if (outputDir != null) {
                  iDDOutputDir = new File(basedir+"/"+outputDir);
                  if (!iDDOutputDir.exists()) {
                      if (!iDDOutputDir.mkdirs()) {
                          throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" could not be created");
                      }
                  }
                  if (!iDDOutputDir.isDirectory() || (!iDDOutputDir.canWrite())) {
                      throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" is not a directory or cannot be written to.");
                  }
              }
              config = new Configuration();
              config.setClassForTemplateLoading(IDLReader.class, "/templates");
  
              config.setStrictSyntaxMode(true);
              this.log = log;
              this.packageName = packageName;
              this.service = service;
              this.client = client;
              this.server = server || !client; // server must be true if client if false.
  
              dataModel = NodeModel.wrap(iddDoc.cloneNode(true));
  
              if (extensionDoc != null) {
                  NodeModel extensionModel = NodeModel.wrap(extensionDoc);
                  mergeExtensionsIntoDocument(getRootNode(dataModel),
                          getRootNode(extensionModel));
                  removeUndefinedOperations(getRootNode(dataModel),
                          getRootNode(extensionModel));
              }
              if(log.isDebugEnabled()) {
                  log.debug(serialize());
              }
          } catch (final Exception e) {
              log.error("Failed to initialise FTL", e);
              throw e;
          }
      }
docs: TODO this arg list is getting out of hand and could be rationalised