title: Count parents by child with specific attribute
body: <p>I have following XML file:</p>
  
  <pre><code>&lt;parent&gt;
    &lt;child status = 'pass'&gt;&lt;/child&gt;
    &lt;child status = 'pass'&gt;&lt;/child&gt;
  &lt;/parent&gt;
    &lt;child status = 'pass'&gt;&lt;/child&gt;
    &lt;child status = 'fail'&gt;&lt;/child&gt;
  &lt;parent&gt;
    &lt;child status = 'pass'&gt;&lt;/child&gt;
    &lt;child status = 'pass'&gt;&lt;/child&gt;
  &lt;/parent&gt;
  &lt;parent&gt;
    &lt;child&gt;
      &lt;child status = 'pass'&gt;&lt;/child&gt;
      &lt;child status = 'fail'&gt;&lt;/child&gt;
    &lt;/child&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>I need to count parents by child's status.  For example if all children has 'pass' status, the parent's status has to be 'pass', but if one of the children has fail status, the overall status has to be 'fail'.   How can I do this by XPath?</p>
  
  <p>Note that some parent can contain child with its own children, so the XPath has to be versatile.  Any ideas?</p>