FOR $pub IN DISTINCT //publisher LET $pri := document("http://www.biblio.com/books.xml") //book/pubinfo[publisher=$pub]/price RETURN $pub, avg($pri)