// Note how the parentheses change the precedence and the result
DOMXPath xpath1 = new DOMXPath("false() and (false() or true())");
Boolean result1 = (Boolean) xpath1.evaluate(null);
assertFalse(result1.booleanValue());
DOMXPath xpath2 = new DOMXPath("false() and false() or true()");
Boolean result2 = (Boolean) xpath2.evaluate(null);
assertTrue(result2.booleanValue());
String expr = xpath1.getRootExpr().getText();
DOMXPath xpath3 = new DOMXPath(expr);
Boolean result3 = (Boolean) xpath3.evaluate(null);