Boolean expressions: AND and OR

The expression E1 and E2 returns true if the effective boolean values of E1 and E2 are both true.

The expression E1 or E2 returns true if the effective boolean values of either or both of E1 and E2 are true.

The specification allows the operands to be evaluated in either order, but Saxon will normally evaluate them left-to-right, which means if you write something like $a instance of xs:integer and $x = (1 to $a), then you won't get an error if $a is not an integer. But the specification doesn't guarantee this.