title: Exists function in XSL When Statement
body: <p>I am using an XSL when clause to transform one XML file to another XML file.  I need to use something like an "exists" function in my when test.</p>
  
  <p>Here's an example source XML:</p>
  
  <pre><code>&lt;People&gt;
      &lt;Person personid="1" location="US" fullname="John Doe"/&gt;
      &lt;Person personid="2" location="US" fullname="Jane Doe"/&gt;
  &lt;/People&gt;
  &lt;Nicknames&gt;
      &lt;Nickname personid="1" nname="Johnny D"/&gt;
  &lt;/Nicknames&gt;
  </code></pre>
  
  <p>Here's my example XSL:</p>
  
  <pre><code>  &lt;xsl:element name="HASNICKNAME"&gt;
      &lt;xsl:choose&gt;
          &lt;!-- If nickname exists in source XML, return true --&gt;
        &lt;xsl:when test="boolean exists function"
          &lt;xsl:text&gt;TRUE&lt;/xsl:text&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
          &lt;xsl:text&gt;FALSE&lt;/xsl:text&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:element&gt;
  </code></pre>
  
  <p>Can someone help with the exists part?</p>