try {
NodeFactory factory = NodeFactory.getInstance();
NodeExtension node = factory.loadNode(configuration);
TuscanyCompositeEntityBuilder builder = new TuscanyCompositeEntityBuilder(node.getDomainComposite());
CompositeEntity compositeEntity = builder.buildCompositeEntity();
DiagramGenerator generator = new DiagramGenerator(compositeEntity, false, baseURL);
Document doc = generator.buildSVGDocument();
return extractSvg(doc);
} finally {
if (currentTCCL != null) {
Thread.currentThread().setContextClassLoader(currentTCCL);
}