xmlModel.getFactoryRegistry().addFactory(
new PageVariableAdapterFactory());
provider = new DocumentPageVariableAdapter(doc);
doc.addAdapter(provider);
provider.refresh();
PageExpressionContext.getCurrent()
.pushPageVarProvider(provider);
Node child = xmlModel.getDocument().getFirstChild();
PreviewConvertContext context = new PreviewConvertContext(this