title: Browse nodes in differents levels with XSLT 1.0
body: <p>I'm on a problem that is starting to get very boring. Indeed, here is the case on which I block:
  Here is my example of my XML:</p>
  
  <pre><code>&lt;Classification&gt;
      &lt;data&gt;
          &lt;value&gt;String1&lt;/value&gt;
          &lt;value&gt;String2&lt;/value&gt;
          &lt;value&gt;content1&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;&lt;/value&gt;
          &lt;value&gt;&lt;/value&gt;
          &lt;value&gt;
              &lt;part&gt;content3&lt;/part&gt;
              &lt;part&gt;content2&lt;/part&gt;
              &lt;part&gt;content1&lt;/part&gt;
          &lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;&lt;/value&gt;
          &lt;value&gt;&lt;/value&gt;
          &lt;value&gt;content1&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;&lt;/value&gt;
          &lt;value&gt;&lt;/value&gt;
          &lt;value&gt;
              &lt;part&gt;content2&lt;/part&gt;
              &lt;part&gt;content4&lt;/part&gt;
          &lt;/value&gt;
      &lt;/data&gt;
  &lt;/Classification&gt;
  </code></pre>
  
  <p>And here is the result I would like to have:</p>
  
  <pre><code>&lt;Classification&gt;
      &lt;data&gt;
          &lt;value&gt;content1&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;content2&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;content3&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;content4&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;String1&lt;/value&gt;
      &lt;/data&gt;
      &lt;data&gt;
          &lt;value&gt;String2&lt;/value&gt;
      &lt;/data&gt;
  &lt;/Classification&gt;
  </code></pre>
  
  <p>I want to explode my xml to have only unique values output. However, I can not solve the problem of value [3] which can be different.</p>
  
  <p>I already use the previous-sibling and recursion. Here is my xsl I use:</p>
  
  <pre><code>&lt;xsl:template name="clearClassificationWithPart"&gt;
      &lt;xsl:param name="recursion"/&gt;
      &lt;xsl:choose&gt;
          &lt;xsl:when test="$recursion &gt; 0"&gt;
              &lt;xsl:for-each select="data[
                  not(./value[$recursion] = preceding-sibling::data/value[$recursion])
                  and not(./value[$recursion]/part = preceding-sibling::data/value[$recursion])
                  and not(./value[$recursion] = preceding-sibling::data/value[$recursion]/part)
                  and not(./value[$recursion]/part = preceding-sibling::data/value[$recursion]/part)]"&gt;
                  &lt;xsl:choose&gt;
                      &lt;xsl:when test="./value[$recursion]/part"&gt;
                          &lt;xsl:for-each select="./value[$recursion]/part"&gt;
                              &lt;data&gt;
                                  &lt;value&gt;&lt;xsl:value-of select="." /&gt;&lt;/value&gt;
                              &lt;/data&gt;
                          &lt;/xsl:for-each&gt;
                      &lt;/xsl:when&gt;
                      &lt;xsl:otherwise&gt;
                          &lt;data&gt;
                              &lt;value&gt;&lt;xsl:value-of select="./value[$recursion]" /&gt;&lt;/value&gt;
                          &lt;/data&gt;
                      &lt;/xsl:otherwise&gt;
                  &lt;/xsl:choose&gt;      
              &lt;/xsl:for-each&gt;
  
              &lt;xsl:call-template name="clearClassificationWithPart"&gt;
                  &lt;xsl:with-param name="recursion" select="$recursion - 1"/&gt;
              &lt;/xsl:call-template&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:otherwise/&gt;
      &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I use XSLT 1.0.</p>
  
  <p>Someone have an idea?
  Thank you for your help!</p>