Node requestNode = DOMUtils.parse(request.newXMLStreamReader());
if (__log.isDebugEnabled()) {
__log.debug("request " + request.toString());
}
exp.bindItem(XQConstants.CONTEXT_ITEM, xqconn.createItemFromNode(requestNode, xqconn.createNodeType()));
XQResultSequence result = exp.executeQuery();
MockQueryResponseDocument response = MockQueryResponseDocument.Factory.parse(result.getSequenceAsStream());
{
XmlOptions opts = new XmlOptions();
List<Object> errors = new ArrayList<Object>();
opts.setErrorListener(errors);
if (!response.validate(opts)) {