ByteArrayOutputStream out = new ByteArrayOutputStream();
Result domResult = new StreamResult(out);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
transformer.transform(source, domResult);
result.addVariable(new NodeVariable(out.toByteArray()));
} catch (TransformerException e) {
log.error(transformError, e);
throw new PluginException(e);
} catch (IllegalAccessException e) {
throw new PluginException(e);