Document doc = dbuilder.parse(inputSource);
// We should associated the cachedXPathAPI object with the message being evaluated
// since that should speedup subsequent xpath expressions.
CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc,xpath);
return iterator.nextNode()!=null;
} catch (Throwable e) {
return false;
}
}