if(var == null) throw new XPathException("No response object found in the current XQuery context.");
	public Sequence eval(Sequence[] args, Sequence contextSequence)		throws XPathException {		RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);				String redirectURI = args[0].getStringValue();		// response object is read from global variable $response		Variable var = myModule.resolveVariable(RequestModule.RESPONSE_VAR);		if (var.getValue().getItemType() != Type.JAVA_OBJECT)			throw new XPathException("Variable $response is not bound to an Java object.");		JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);		if (value.getObject() instanceof ResponseWrapper)			try {				((ResponseWrapper) value.getObject()).sendRedirect(redirectURI);			} catch (IOException e) {				throw new XPathException("IO exception occurred during redirect: " + e.getMessage(), e);			}		else			throw new XPathException("Variable response is not bound to a response object.");		return Sequence.EMPTY_SEQUENCE;	}