FunctionExecutionException {
boolean emptyOnEmpty = true;
if (xmlQuery.getEmptyOnEmpty() != null) {
emptyOnEmpty = xmlQuery.getEmptyOnEmpty();
}
Result result = null;
try {
result = evaluateXQuery(xmlQuery.getXQueryExpression(), xmlQuery.getPassing(), tuple);
return xmlQuery.getXQueryExpression().createXMLType(result.iter, this.context.getBufferManager(), emptyOnEmpty);
} catch (TeiidProcessingException e) {
throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
} catch (XPathException e) {
throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
} finally {
if (result != null) {
result.close();
}
}
}