Each location step can have zero or more predicates that further filter the node-set.
A predicate is an XPath expression in square brackets that is evaluated for each node selected by the location step. If the predicate is true, then the node is kept in the node-set. If the predicate is false, then the node is removed from the node-set.
If the predicate returns a number, then the node is kept in the set only if the number is equal to the position of the context node in the context node list.
If the predicate returns a string, then the context node is deleted from the set if the string is empty and kept otherwise.
If the predicate returns a node-set, then the source node is kept in the returned set only if the predicate node-set is non-empty. It is deleted otherwise.
child::ATOM[position() = 1]
child::ATOM[starts-with("NAME", "H")]
child::ATOM[ATOMIC_NUMBER="3"]
child::ATOM[ATOMIC_NUMBER > 3 ][ATOMIC_WEIGHT < 200]
descendant::ATOM[SYMBOL="He"]
child::ATOM[SYMBOL="Fe"]