title: How to combine Where clauses in xQuery
body: <p>I'm not sure what I'm doing wrong here but I'm trying to set two conditions through using "where" and they each work alone, but when I combine them I get a dump of every file.</p>
  
  <p>If I simply have:</p>
  
  <pre><code>for $i in collection("/db/people")
  where $i//lastname="Smith"
  return $i
  </code></pre>
  
  <p>I get two listings because there are two types (a &amp; b). </p>
  
  <p>If I have </p>
  
  <pre><code>for $i in collection("/db/people")
  where $i//type="a"
  return $i
  </code></pre>
  
  <p>I get 538 listings which is everything of type "a".</p>
  
  <p>However, if I have:</p>
  
  <pre><code>for $i in collection("/db/people")
  where  $i//type="a" and $i//lastname="Smith"
  return $i
  </code></pre>
  
  <p>I get all of the files. Why isn't it just giving me the single file with the name and type I've specified? It seems like I'm missing something obvious!</p>