True and false are returned by built-in XPath functions. Node attributes set to "true" or "false" are just strings. Use string comparison to convert them to booleans. Test an attribute for its presence (empty or not), or whether a node set is empty.