protected XPathExpression createXPath(String expression) throws XPathExpressionException
{
XPath xp = XPathFactory.newInstance().newXPath();
if (getNamespaceManager() != null)
{
xp.setNamespaceContext(new MapNamespaceContext(getNamespaceManager().getNamespaces()));
}
return xp.compile(expression);
}