title: Checking for values in XSLT and condition
body: <p>Rephrasing my question properly:</p>
  
  <p>I have XSLT where I need to check for node values for specific data. 
  E.g. (pseudocode):</p>
  
  <pre><code>If only H occurs then set target element value as 'H'
  Else if
      Only B or N then set target element value as 'BN'
  </code></pre>
  
  <p>If Source XML:</p>
  
  <pre><code>&lt;n1&gt;N&lt;/n1&gt;
  &lt;n1&gt;B&lt;/n1&gt;
  &lt;n1&gt;N&lt;/n1&gt;
  </code></pre>
  
  <p>Target node:
      BN</p>
  
  <p>If Source XML:</p>
  
  <pre><code>&lt;n1&gt;H&lt;/n1&gt;
  &lt;n1&gt;H&lt;/n1&gt;
  &lt;n1&gt;H&lt;/n1&gt;
  </code></pre>
  
  <p>Target node:
      H</p>
  
  <p>There is no attribute. I have to only set text on meeting the condition in the target node.</p>
  
  <p>Can I use something like:</p>
  
  <pre><code>&lt;xsl:variable name="elements"&gt;
  &lt;xsl:for-each select="/test/elem"&gt;
  &lt;xsl:value-of select="."/&gt;
  &lt;xsl:if test="position() &lt; last()"&gt;
  &lt;/xsl:if&gt;
  &lt;/xsl:for-each&gt;
  &lt;/xsl:variable&gt;
  </code></pre>
  
  <p>Would the above give me concat of all element values and then I can do a check to see the if that contains x then I can do a set text?</p>