MetaObject mj = new MetaObjectImpl(source);
Document root = DOMHelper.newDocument();
DomWriter out = new DomWriter(DOMHelper.newDocument());
XStream xs = new XStream();
xs.alias("xobject", mj.getClass());
xs.marshal(source, out);
DOMHelper.adjustElementName(context, root.getDocumentElement());
return root;
} catch (Exception e) {
throw new TransformationException(e);
}