Code example for XPathExpression

Methods: evaluate

0
			ch = Charset.defaultCharset().name();
		} 
		Document doc = toDocument(content, charset);
		XPathExpression expr = toExpression(ns, xpathExpression);
		try { 
			Object o = expr.evaluate(doc, returnType);
			return o;
		} catch (XPathExpressionException e) {
			throw new IllegalArgumentException(
					"xPath expression cannot be executed: " + xpathExpression);
		} 
	} 
 
	/** 
	 * @param result 
	 * @return the serialised as xml result of an xpath expression evaluation 
	 */ 
	public static String xPathResultToXmlString(Object result) {
		if (result == null) {
			return null; 
		}