private void executeXQuery(final DBBroker broker, final DocumentImpl resource,
final HttpServletRequest request, final HttpServletResponse response,
final Properties outputProperties, final String servletPath, final String pathInfo)
throws XPathException, BadRequestException, PermissionDeniedException {
final Source source = new DBSource(broker, (BinaryDocument) resource, true);
final XQuery xquery = broker.getXQueryService();
final XQueryPool pool = xquery.getXQueryPool();
XQueryContext context;
CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);