title: xpath count function
body: <p>I am trying to use XPath count function to determine how many elements are returned by following query</p>
  
  <pre><code>doc("courses.xml")
  count(//Course[contains(Description,"Cross-listed")])
  </code></pre>
  
  <p>The following code returns 2 course elements</p>
  
  <pre><code> doc("courses.xml")
  //Course[contains(Description,"Cross-listed")]
  </code></pre>
  
  <p>but when I try to use the count function as above to return "2"  I get the following error.</p>
  
  <p>Error on line 2 column 1 of tmpDfWgJ7.xq:
   XPST0003 XQuery syntax error in #doc("courses.xml")
  count(//#:
   Unexpected token "(" beyond end of query
  Static error(s) in query</p>
  
  <p>How can I correct this?</p>