Non-boolean results are converted as follows:
A number is false if it's zero or NaN (a special symbol meaning "Not a Number", used for the result of dividing by zero and similar illegal operations), true otherwise.
An empty node set is false; all other node sets are true.
An empty result fragment is false; all other result fragments are true.
A zero length string is false; all other strings are true (including the string "false")
The predicate expression is evaluated for each node in the context node list. Each node for which the expression ultimately evaluates to false is removed from the list. Thus only those nodes that satisfy the predicate remain.