This is also not guaranteed. You can, however, write,

[if (. castable as xs:integer) then (. = 21) else false() ]

True; thanks, Liam. In BaseX, specifically, sequential evaluation is guaranteed for all three variants (if; and; multiple predicates).