}
else
{
//transform:stream-transform()
final ResponseModule myModule = (ResponseModule)context.getModule(ResponseModule.NAMESPACE_URI);
// response object is read from global variable $response
final Variable respVar = myModule.resolveVariable(ResponseModule.RESPONSE_VAR);
if(respVar == null)
{throw new XPathException(this, "No response object found in the current XQuery context.");}
if(respVar.getValue().getItemType() != Type.JAVA_OBJECT)
{throw new XPathException(this, "Variable $response is not bound to an Java object.");}
final JavaObjectValue respValue = (JavaObjectValue)