result.sources.add(source);
if (contextRoot != null) {
//create our own filter as this logic is not provided in the free saxon
ProxyReceiver filter = new PathMapFilter(contextRoot);
AugmentedSource sourceInput = AugmentedSource.makeAugmentedSource(source);
sourceInput.addFilter(filter);
source = sourceInput;
}
DocumentInfo doc;
try {
doc = config.buildDocument(source);