Condition<XmlElement> () { if (StringUtil.isEmptyOrSpaces(myXPathCondition)) return Conditions.alwaysTrue(); try { XPathSupportProxy xPathSupport = XPathSupportProxy.getInstance(); if (xPathSupport != null) { XPath path = xPathSupport.createXPath(myXPathCondition); return context -> { try { return path.booleanValueOf(context); } catch (JaxenException e) { LOG.warn(e); myCompiledXPathCondition = Conditions.alwaysFalse(); return false; } }; } } catch (JaxenException e) { LOG.warn("Invalid XPath expression", e); } return Conditions.alwaysFalse(); }