title: XPath Exclude nodes based on attributes of multiple other nodes
body: <p>I'm trying to write XPath against the XML below that will get me all nodes in the list with @id='ResponseActionList' for a specific @rsp_cd where the @act_cd does not exist in the list with @id='ActExcludeList'</p>
  
  <pre><code>&lt;resp-env&gt;
     &lt;cmd-resp&gt;
        &lt;static&gt;
           &lt;list id="ResponseActionList"&gt;
              &lt;listRow rsp_cd="R1" act_cd="A1" act_tx="A1 Text"/&gt;
              &lt;listRow rsp_cd="R1" act_cd="A2" act_tx="A2 Text"/&gt;
              &lt;listRow rsp_cd="R1" act_cd="A4" act_tx="A4 Text"/&gt;
              &lt;listRow rsp_cd="R1" act_cd="A5" act_tx="A5 Text"/&gt;
              &lt;listRow rsp_cd="R1" act_cd="A6" act_tx="A6 Text"/&gt;
              &lt;listRow rsp_cd="R1" act_cd="A7" act_tx="A7 Text"/&gt;
              &lt;listRow rsp_cd="R2" act_cd="A1" act_tx="A1 Text"/&gt;
              &lt;listRow rsp_cd="R2" act_cd="A2" act_tx="A2 Text"/&gt;
              &lt;listRow rsp_cd="R2" act_cd="A3" act_tx="A3 Text"/&gt;
              &lt;listRow rsp_cd="R2" act_cd="A4" act_tx="A4 Text"/&gt;
              &lt;listRow rsp_cd="R2" act_cd="A5" act_tx="A5 Text"/&gt;
              &lt;listRow rsp_cd="R2" act_cd="A6" act_tx="A6 Text"/&gt;
           &lt;/list&gt;
           &lt;list id="ActExcludeList"&gt;
              &lt;listRow act_cd="A2"/&gt;
              &lt;listRow act_cd="A3"/&gt;
           &lt;/list&gt;
        &lt;/static&gt;
     &lt;/cmd-resp&gt;
  &lt;/resp-env&gt;
  </code></pre>
  
  <p>I can easily get all the nodes containing the appropriate @rsp_cd with this:</p>
  
  <pre><code>//static/list[@id='ResponseActionList']/listRow[@rsp_cd='R2']
  </code></pre>
  
  <p>And I can exclude nodes for a particular @act_cd with this:</p>
  
  <pre><code>//static/list[@id='ResponseActionList']/listRow[@rsp_cd='R2' and @act_cd!='A2']
  </code></pre>
  
  <p>What I want is to exclude all nodes from the first expression above where the @act_cd attribute is not in the results of this expression:</p>
  
  <pre><code>//static/list[@id='ActExcludeList']/listRow/@act_cd
  </code></pre>
  
  <p>I tried something like this, which I didn't expect to work, and I'm not sure what to try next:</p>
  
  <pre><code>//static/list[@id='ResponseActionList']/listRow[@rsp_cd='R2' and not(contains(//static/list[@id='ActExcludeList']/listRow/@act_cd,@act_cd))]
  </code></pre>