QName q = (QName)value;
return new QNameValue(q.getPrefix(), q.getNamespaceURI(), q.getLocalPart(),
BuiltInAtomicType.QNAME, null);
} else if (value instanceof Node) {
//return (Item)(new DOMObjectModel().convertObjectToXPathValue(value, config));
DOMObjectModel model = new DOMObjectModel();
DocumentInfo wrapper = model.wrapDocument(value, "", config);
NodeInfo node = model.wrapNode(wrapper, value);
return node;
} else if (value instanceof Source) {
// Saxon extension to the XQJ specification
Builder b = new TinyBuilder();
PipelineConfiguration pipe = config.makePipelineConfiguration();