title: how to check an existing node and its contains in an xml file using xslt and differenciate the node by an id number
body: <p>Is there any possibility to check if it exists a duplicate node in an xml file, then check the contains of this node and if possible differenciate the both node by an Id number using xslt?
  I have for example this xml file</p>
  
  <pre><code>&lt;Racine&gt;
    &lt;el1&gt;
     &lt;fils1&gt;context1&lt;/fils1&gt;
     &lt;fils2&gt;test1&lt;/fils2&gt;
     &lt;fils1&gt;context1&lt;/fils1&gt;
    &lt;/el1&gt;
    &lt;el2&gt;
     &lt;fils1&gt;context2&lt;/fils1&gt;
     &lt;fils2&gt;test2&lt;/fils2&gt;
     &lt;fils1&gt;context2&lt;/fils1&gt;
    &lt;/el2&gt;
    &lt;el3&gt;...........&lt;el3&gt;
  &lt;/Racine&gt;
  </code></pre>
  
  <p>In this case for example, the node "<strong>fils1</strong>" appears twice in the node "<strong>el1</strong>" and the contains of each of them is the same. I need in this case to transform my xml file so that this node will become</p>
  
  <pre><code>&lt;fils1 id=1&gt;context1&lt;/fils1&gt;.
  </code></pre>
  
  <p>I add automatically an Id-number to differenciate the both node with the same name and same contain. And when the node got the same name with different contains( also a space in the contain of the node has to be considered as a difference), then lets the node as they are.
  How can i make this possible using XSLT? Could someone here help me to transform that?
  Thanks a lot for your help.<br>
  Franky</p>
  
  <p>Thanks for yours remarks. Here is the expected output: </p>
  
  <pre><code>&lt;Racine&gt;
    &lt;el1&gt;
     &lt;fils1 id=1&gt;context1&lt;/fils1&gt;
     &lt;fils2&gt;test1&lt;/fils2&gt;
     &lt;fils1 id=2&gt;context1&lt;/fils1&gt;
    &lt;/el1&gt;
    &lt;el2&gt;
     &lt;fils1 id=1&gt;context2&lt;/fils1&gt;
     &lt;fils2&gt;test2&lt;/fils2&gt;
     &lt;fils1 id=2&gt;context2&lt;/fils1&gt;
    &lt;/el2&gt;
    &lt;el3&gt;...........
     &lt;fils1 id=3&gt;context1&lt;/fils1&gt;
    &lt;el3&gt;
  &lt;/Racine&gt;
  </code></pre>
  
  <p>Conerning the node "<strong>fils2</strong>" in "<strong>el1</strong>" and "<strong>el2</strong>", the contain is different, then i want to keep them unchange and when not, i want to add an id number to make the difference.</p>