'hasLevel' predicate needs to deal with arbitrary node counts