FOR $pub IN DISTINCT //publisher LET $bk := //book[pubinfo/publisher=$pub AND pubinfo/year="1999"] WHERE count($bk) > 100 RETURN $pub