How to extract the first element of a list in XQuery 1.0?
<p>I want to extract the first element form the list <code>$res/Name</code>. In my solution I obtain all the list and not only the first element, here is what I wrote.</p>

<pre><code>for $res in /Restaurants/Restaurant
let $n := count($res/Dish)
order by $n descending
return ($res/Name)[1]
</code></pre>

<p>You can see here the XML and the result: <a href="http://www.xpathtester.com/xquery/7992b12910492f493273835e828dc386" rel="nofollow">http://www.xpathtester.com/xquery/7992b12910492f493273835e828dc386</a></p>

<p>Where is the problem?</p>