title: XQuery grouping and finding max values
body: <p>my XML document looks like the following:</p>
  
  <pre><code>&lt;books&gt;
      &lt;book&gt;&lt;author&gt;A&lt;/author&gt;&lt;/book&gt;
      &lt;book&gt;&lt;author&gt;B&lt;/author&gt;&lt;/book&gt;
      &lt;book&gt;&lt;author&gt;C&lt;/author&gt;&lt;/book&gt;
      &lt;book&gt;&lt;author&gt;B&lt;/author&gt;&lt;/book&gt;
      &lt;book&gt;&lt;author&gt;C&lt;/author&gt;&lt;/book&gt;
  &lt;/books&gt;
  </code></pre>
  
  <p>Now, the query should return the name of the authors with the most books. In this case <code>B,C</code> (since both have 2 books). The problem is, that it has to be only one query, so finding the maximum (2) and then searching for authors with 2 books is not an acceptable solution in this case.</p>