// This method is weird. It seems the user is expected to supply an XMLReader that already
// knows what document it is supposed to read!
try {
Source ss = new SAXSource(value, new InputSource("dummy"));
ss = augmentSource(ss, type);
AugmentedSource as = AugmentedSource.makeAugmentedSource(ss);
as.setSourceIsXQJ(true);
DocumentInfo doc = getConfiguration().buildDocument(as);
checkDocumentType(doc, (SaxonXQItemType)type);
return new SaxonXQItem(doc, this);
} catch (XPathException de) {
throw newXQException(de);