title: Check if node exist in document with XSLT
body: <p>I'm transforming one XML file to another XML format. </p>
  
  <p>Here is sample source file:</p>
  
  <pre><code>&lt;xml&gt;
       &lt;title&gt;Pride and Prejudice&lt;/title&gt;
       &lt;subtitle&gt;Love Novel&lt;/subtitle&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>And here is xsl file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0"
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
  &lt;xsl:template match="/"&gt;
      &lt;Product&gt;
          &lt;xsl:apply-templates/&gt;
      &lt;/Product&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="title"&gt;
      &lt;TitleDetail&gt;
          &lt;TitleType&gt;01&lt;/TitleType&gt;
          &lt;TitleElement&gt;
              &lt;TitleElementLevel&gt;01&lt;/TitleElementLevel&gt;
              &lt;TitleText&gt;&lt;xsl:value-of select="current()"/&gt;&lt;/TitleText&gt;
               &lt;!--Here Problem!!!--&gt;
              &lt;xsl:if test="subtitle"&gt; 
                  &lt;Subtitle&gt;123&lt;/Subtitle&gt;
              &lt;/xsl:if&gt;
          &lt;/TitleElement&gt;
      &lt;/TitleDetail&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>Idea is that if source file contains subtitle tag I need to insert  "Subtitle"  node to the "TitleDetail", but 'if' condition returns false. How to check if source file has subtitle information?</p>