title: XML-XSLT-XPATH : How to fetch duplicate records?
body: <p><strong>Greetings all,</strong><br/>
  I am new to XML-XSLT-XPATH, therefore I stuck with the below scenario.<br/>
  I want to fetch records of which name and firstname are repeating.<br/>
  For example : if <strong>User A</strong> has <strong>name="abc"</strong> &amp; <strong>firstname="xyz"</strong> and <strong>User B</strong> has <strong>name="abc"</strong> &amp; <strong>firstname="xyz"</strong>, then it should say that User A has duplicate with User B and vice versa. <em>Well,</em> I have an input XML like below.</p>
  
  <pre><code>     &lt;userlist&gt;
          &lt;user&gt;abc@gmail.com
             &lt;name&gt;abc&lt;/name&gt;
             &lt;firstname&gt;xyz&lt;/firstname&gt;
             &lt;email&gt;abc@gmail.com&lt;/email&gt;
             &lt;userid&gt;abcxy&lt;/userid&gt;
          &lt;/user&gt;
          &lt;user&gt;abc1@gmail.com
             &lt;name&gt;abc&lt;/name&gt;
             &lt;firstname&gt;xyz&lt;/firstname&gt;
             &lt;email&gt;abc1@gmail.com&lt;/email&gt;
             &lt;userid&gt;abc1xy&lt;/userid&gt;
          &lt;/user&gt;
          &lt;user&gt;abc2@gmail.com
             &lt;name&gt;abc2&lt;/name&gt;
             &lt;firstname&gt;xyz2&lt;/firstname&gt;
             &lt;email&gt;abc2@gmail.com&lt;/email&gt;
             &lt;userid&gt;abc2xy&lt;/userid&gt;
          &lt;/user&gt;
          &lt;user&gt;abc3@gmail.com
             &lt;name&gt;abc3&lt;/name&gt;
             &lt;firstname&gt;xyz3&lt;/firstname&gt;
             &lt;email&gt;abc3@gmail.com&lt;/email&gt;
             &lt;userid&gt;abc3xy&lt;/userid&gt;
          &lt;/user&gt;
  &lt;/userlist&gt;
  </code></pre>
  
  <p>"Expected Output" :</p>
  
  <pre><code>&lt;duplicatUserList&gt;
    &lt;user&gt;abc@gmail.com
             &lt;name&gt;abc&lt;/name&gt;
             &lt;firstname&gt;xyz&lt;/firstname&gt;
             &lt;email&gt;abc@gmail.com&lt;/email&gt;
             &lt;userid&gt;abcxy&lt;/userid&gt;
     &lt;/user&gt;
      &lt;user&gt;abc1@gmail.com
             &lt;name&gt;abc&lt;/name&gt;
             &lt;firstname&gt;xyz&lt;/firstname&gt;
             &lt;email&gt;abc1@gmail.com&lt;/email&gt;
             &lt;userid&gt;abc1xy&lt;/userid&gt;
      &lt;/user&gt;
  &lt;/duplicateUserList&gt;
  </code></pre>
  
  <p>It may be what I asked is very easy but as I told I am new to this XSLT-XPath.
  Need XSLT to fetch duplicate records.
  Any help will be greatly appreciated.
  Thank you well in advance.</p>