title: Count function in XPath
body: <p>I have got an XML document and trying to get the number of nodes that have a particular text using xpath. see xml below</p>
  
  <p>count(//event_type) returns the number of event_type nodes but what I want is
  the number of event_type nodes that have the Error text.</p>
  
  <pre><code>  &lt;Response&gt;
      &lt;run_id&gt;20091231-105000&lt;/run_id&gt;
      &lt;message&gt;
        &lt;timestamp&gt;2009-12-31T10:50:00.46875+00:00&lt;/timestamp&gt;
        &lt;event_type&gt;Information&lt;/event_type&gt;
        &lt;operation&gt;LoadProjects&lt;/operation&gt;
        &lt;error_code /&gt;
        &lt;details&gt;LoadProjects request detected&lt;/details&gt;
      &lt;/message&gt;
      &lt;message&gt;
        &lt;timestamp&gt;2009-12-31T10:50:02.296875+00:00&lt;/timestamp&gt;
        &lt;event_type&gt;Error&lt;/event_type&gt;
        &lt;operation&gt;Processor.InitaliseDCFiles&lt;/operation&gt;
        &lt;error_code /&gt;
        &lt;details&gt;some error details&lt;/details&gt;
      &lt;/message&gt;
      &lt;message&gt;
        &lt;timestamp&gt;2009-12-31T10:50:02.296875+00:00&lt;/timestamp&gt;
        &lt;event_type&gt;Debug&lt;/event_type&gt;
        &lt;operation&gt;Processor.InitaliseDCFiles&lt;/operation&gt;
        &lt;error_code /&gt;
        &lt;details&gt;some details&lt;/details&gt;
      &lt;/message&gt;
    &lt;Response&gt;  
  </code></pre>
  
  <p>Thanks </p>