title: XSLT finding last parent's preceding sibling with non zero value
body: <p>XML:</p>
  
  <pre><code>   &lt;h&gt;
      &lt;rl&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
      &lt;/rl&gt;
      &lt;rl&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c&gt;.01&lt;/c&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
      &lt;/rl&gt;
      &lt;rl&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
      &lt;/rl&gt;
      &lt;rl&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c/&gt;
        &lt;c&gt;.01&lt;/c&gt;
        &lt;c&gt;.01&lt;/c&gt;
        &lt;c&gt;.01&lt;/c&gt;
        &lt;c&gt;.01&lt;/c&gt;
      &lt;/rl&gt;
  &lt;/h&gt;
  </code></pre>
  
  <p>The problem I faced is:</p>
  
  <p>I need to select a value from 4th <code>&lt;c&gt;</code> element of every <code>&lt;rl&gt;</code> element with special conditions: 
  Let's say, that <code>rl[3]/c[4]</code> is my current node. I need to find last parent's sibling with non zero value in <code>c[4]</code> and check it's value (in this case it would be <code>rl[2]/c[4]</code> which is 0.01).</p>
  
  <p>Any ideas are appreciated.</p>
  
  <p>/EDIT
  Maybe I wasn't clear enough:
  I never know in which <code>rl</code> element I have this non-zero value, so the formula must be artful enough to find it. In this case, non zero value is inside the second <code>rl</code> element but it may be in 1st or 3rd and if I will be matching 4th, 5th and so on <code>rl</code> element, it needs to find a value from non empty <code>rl</code> element at every step.</p>