QName qname = qnameFromForm(name, getQuery());
Vector<XdmItem> nodes = new Vector<XdmItem>();
try {
ReadablePipe pipe = null;
if (isXml(entity.getMediaType())) {
XdmNode doc = runtime.parse(new InputSource(entity.getStream()));
pipe = new ReadableDocument(runtime, doc, null, null, null);
} else {
pipe = new ReadableData(runtime, XProcConstants.c_data, entity.getStream(), entity.getMediaType().toString());
}
while (pipe.moreDocuments()) {
XdmNode doc = pipe.read();
nodes.add(doc);
}
} catch (Exception e) {
throw new XProcException(e);
}