protected void queryContent(XQueryExpression expression, MessageExchange exchange,
NormalizedMessage in, NormalizedMessage out) throws Exception {
Configuration config = getConfiguration();
DynamicQueryContext dynamicEnv = new DynamicQueryContext(config);
DocumentInfo doc = staticEnv.buildDocument(in.getContent());
dynamicEnv.setContextItem(doc);
configureQuery(dynamicEnv, exchange, in);
Properties props = outputProperties != null ? outputProperties : EMPTY_PROPS;
if (RESULT_BYTES.equalsIgnoreCase(getResult())) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();