NodeInfo node = b.getCurrentRoot();
b.reset();
return node;
} else if (value instanceof XMLStreamReader) {
// Saxon extension to the XQJ specification
StaxToEventBridge bridge = new StaxToEventBridge();
bridge.setXMLStreamReader((XMLStreamReader)value);
PipelineConfiguration pipe = config.makePipelineConfiguration();
bridge.setPipelineConfiguration(pipe);
Builder b = new TinyBuilder();
b.setPipelineConfiguration(pipe);
new Sender(pipe).send(new PullEventSource(bridge), b, null);
NodeInfo node = b.getCurrentRoot();
b.reset();