Dom dom = Dom.unwrap(entity);
DomDocument document = dom.document;
ConfigModel rootModel = dom.document.getRoot().model;
ResourcesGenerator resourcesGenerator = new TextResourcesGenerator(outputDir, habitat);
resourcesGenerator.generateSingle(rootModel, document);
resourcesGenerator.endGeneration();
} catch (Exception ex) {
Logger.getLogger(GeneratorResource.class.getName()).log(Level.SEVERE, null, ex);
retVal = "Exception encountered during generation process: " + ex.toString() + "\nPlease look at server.log for more information.";
}