Thanks wroos! Copying here in case the link goes down: a boolean false result, such as from the expression 1 > 2, is stored in the model as the string "false". When referring to that node in another expression as a boolean argument, the string value of that node (“false”) is converted to a boolean by calling the boolean() function which returns the boolean true because boolean("false") = true(). To deal with this, it usually best to not do boolean comparisons with stored values (compare strings instead) or use boolean-from-string() in the XPath comparison expression.