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