title: Xquery how to use count
body: <pre><code>&lt;state&gt;
  &lt;hospital&gt;
  &lt;ambulances&gt; 1 &lt;/ambulances&gt;
  &lt;/hospital&gt;
  
  &lt;hospital&gt;
  &lt;ambulances&gt; 0 &lt;/ambulances&gt;
  &lt;/hospital&gt;
  
  &lt;hospital&gt;
  &lt;ambulances&gt; 2 &lt;/ambulances&gt;
  &lt;/hospital&gt;
  &lt;/state&gt;
  </code></pre>
  <p>I'm trying to do a count in Xquery 3.0 where I count all ambulances which are above 0</p>
  <p>Blockquote</p>
  <p>I've tried</p>
  <p>for $i in doc(&quot;my.xml&quot;)//state let $x := $i//ambulances let $count :=
  count(x != 0)</p>
  <p>return {$count}</p>
  <p>but my loops keeps executing in which it replies back with {1 , 1}</p>