title: XPath to identify the elements from the list having none of the child elements with a particular value
body: <p>My problem statement is to identify the films from the list in which a specific actor has not worked on.</p>
  
  <p>e.g., I want to identify the films in which <code>"Actor1"</code> has not worked on.</p>
  
  <p>The XPATH which I am using is returning all the films in which at least there is one actor other than the <code>"Actor1"</code>.</p>
  
  <p>XPATH: <code>//film[.//actor/name[not(text()='Actor1')]]</code></p>
  
  <p>XML Input:</p>
  
  <pre><code>&lt;list&gt;
      &lt;!-- Film1 --&gt;
      &lt;film&gt;
          &lt;name&gt;Film1&lt;/name&gt;
          &lt;duration&gt;3&lt;/duration&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor1&lt;/name&gt;
              &lt;age&gt;40&lt;/age&gt;
          &lt;/actor&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor2&lt;/name&gt;
              &lt;age&gt;30&lt;/age&gt;
          &lt;/actor&gt;
      &lt;/film&gt;
      &lt;!-- Film2 --&gt;
      &lt;film&gt;
          &lt;name&gt;Film2&lt;/name&gt;
          &lt;duration&gt;2&lt;/duration&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor3&lt;/name&gt;
              &lt;age&gt;34&lt;/age&gt;
          &lt;/actor&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor1&lt;/name&gt;
              &lt;age&gt;40&lt;/age&gt;
          &lt;/actor&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor4&lt;/name&gt;
              &lt;age&gt;26&lt;/age&gt;
          &lt;/actor&gt;
      &lt;/film&gt;
      &lt;!-- Film3 --&gt;
      &lt;film&gt;
          &lt;name&gt;Film3&lt;/name&gt;
          &lt;duration&gt;2&lt;/duration&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor2&lt;/name&gt;
              &lt;age&gt;30&lt;/age&gt;
          &lt;/actor&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor5&lt;/name&gt;
              &lt;age&gt;16&lt;/age&gt;
          &lt;/actor&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor6&lt;/name&gt;
              &lt;age&gt;5&lt;/age&gt;
          &lt;/actor&gt;
      &lt;/film&gt;
      &lt;!-- Film4 --&gt;
      &lt;film&gt;
          &lt;name&gt;Film4&lt;/name&gt;
          &lt;duration&gt;1&lt;/duration&gt;
          &lt;actor&gt;
              &lt;name&gt;Actor1&lt;/name&gt;
              &lt;age&gt;40&lt;/age&gt;
          &lt;/actor&gt;
      &lt;/film&gt;
  &lt;/list&gt;
  </code></pre>
  
  <p>EXPECTED: Only node for <code>"Film3"</code> should be returned</p>
  
  <p>ACTUAL: XPath result</p>
  
  <pre><code>&lt;film&gt;
      &lt;name&gt;Film1&lt;/name&gt;
      &lt;duration&gt;3&lt;/duration&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor1&lt;/name&gt;
          &lt;age&gt;40&lt;/age&gt;
      &lt;/actor&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor2&lt;/name&gt;
          &lt;age&gt;30&lt;/age&gt;
      &lt;/actor&gt;
  &lt;/film&gt;
  &lt;film&gt;
      &lt;name&gt;Film2&lt;/name&gt;
      &lt;duration&gt;2&lt;/duration&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor3&lt;/name&gt;
          &lt;age&gt;34&lt;/age&gt;
      &lt;/actor&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor1&lt;/name&gt;
          &lt;age&gt;40&lt;/age&gt;
      &lt;/actor&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor4&lt;/name&gt;
          &lt;age&gt;26&lt;/age&gt;
      &lt;/actor&gt;
  &lt;/film&gt;
  &lt;film&gt;
      &lt;name&gt;Film3&lt;/name&gt;
      &lt;duration&gt;2&lt;/duration&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor2&lt;/name&gt;
          &lt;age&gt;30&lt;/age&gt;
      &lt;/actor&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor5&lt;/name&gt;
          &lt;age&gt;16&lt;/age&gt;
      &lt;/actor&gt;
      &lt;actor&gt;
          &lt;name&gt;Actor6&lt;/name&gt;
          &lt;age&gt;5&lt;/age&gt;
      &lt;/actor&gt;
  &lt;/film&gt;
  </code></pre>