title: How to pick value of multiple nodes and test it in a single condition?
body: <p>In continuation to this <a href="https://stackoverflow.com/questions/66116296/how-to-check-for-various-conditions-and-return-an-accumulated-result-in-xslt">post</a>, I have restructured the code to better understand my requirement. I have also provided more detail to it.</p>
  <p><strong>XML FILE</strong></p>
  <pre><code>&lt;Person&gt;
    &lt;Name&gt;Kavya&lt;/Name&gt;
    &lt;Gift&gt;
      &lt;ItemName&gt;PD1&lt;/ItemName&gt;
    &lt;/Gift&gt;
    &lt;Gift&gt;
      &lt;ItemName&gt;PS1&lt;/ItemName&gt;
    &lt;/Gift&gt;
    &lt;Gift&gt;
      &lt;ItemName&gt;PD2&lt;/ItemName&gt;
    &lt;/Gift&gt;
  &lt;/Person&gt;
  </code></pre>
  <p>Now, In the above structure, I need to return a text <strong>Successfull</strong> only when the <strong>Person</strong> has a <strong>Gift</strong> with <strong>ItemName</strong> that is <strong>empty</strong> or has only <strong>PS1</strong> and not <strong>PD1</strong> or <strong>PD2</strong>. So, when writing an XSLT file, I used the below approach:</p>
  <p><strong>XSLT File ( Example )</strong></p>
  <pre><code>&lt;Test&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;//Person/Gift[ItemName='PS1' and ItemName!='PD1']&quot;&gt;
        &lt;xsl:text&gt;Successfull&lt;/xsl:text&gt;
      &lt;/xsl:when&gt;
    &lt;/xsl:choose&gt;
  &lt;/Test&gt;
  </code></pre>
  <p>As of now, it returns Successfull, since one of the Gifts has ItemName as 'PS1'. But, according to my need, it must not display anything since, although there is an ItemName as 'PS1', the person yet has gifts with ItemName as 'PD1' and 'PD2'</p>
  <p>To be precise, I don't want to check individual ItemName in Gift. I am trying to check if the Person ( as a whole ) has PS1 and not PD1 or PD2</p>
  <p>Hoping this is clear. Kindly assist.</p>