title: XSL condition to check if node exists
body: <p>I want to check if in my XML exists node that has type attribute containing string <code>type_attachment_</code>.  </p>
  
  <p>Is it a correct way to check it?</p>
  
  <pre><code>&lt;xsl:if test="count(*[contains(@Type, 'type_attachment_')]) &amp;gt; 0"&gt;
     something
  &lt;/xsl:if&gt;
  </code></pre>
  
  <p>I don't know how nested can this node be. It can be for example as simple as that:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;?xml-stylesheet type="text/xsl"?&gt;
  
  &lt;hello-world&gt;
   &lt;greeter&gt;
    &lt;dsdsds&gt;An XSLT Programmer
     &lt;greeting type = 'type_attachment_'&gt;Hello, World!
     &lt;/greeting&gt;
    &lt;/dsdsds&gt;
   &lt;/greeter&gt;
  &lt;/hello-world&gt;
  </code></pre>
  
  <p>but can also contain this node nested in different other elements.</p>