title: delete nodes from xml file having duplicate ID using xsl
body: <p>I have xml as below:</p>
  
  <pre><code>&lt;panel id="MainPanel" x="0" y="0" w="100%" h="100%" backgroundcolor="green" &gt;
  
    &lt;panel id="somepanel" x="0" y="130" w="100%" h="PANEL_ALIGN" backgroundcolor="red" &gt;
      &lt;panel id="nextpanel" x="0" y="130" w="100%" h="PANEL_ALIGN" backgroundcolor="red" &gt;
         &lt;table id="TestPanel" x="1%" y="20" w="98%" h="PANEL_ALIGN""&gt;&lt;/table&gt;
         &lt;table id="TestPanel" x="1%" y="20" w="98%" h="PANEL_ALIGN""&gt;&lt;/table&gt;
         &lt;table id="TestPanel2" x="1%" y="20" w="98%" h="PANEL_ALIGN""&gt;&lt;/table&gt;
       &lt;/panel&gt;
    &lt;/panel&gt;
  </code></pre>
  
  <p>Expected is:</p>
  
  <pre><code>&lt;panel id="MainPanel" x="0" y="0" w="100%" h="100%" backgroundcolor="green" &gt;
  
    &lt;panel id="somepanel" x="0" y="130" w="100%" h="PANEL_ALIGN" backgroundcolor="red" &gt;
      &lt;panel id="nextpanel" x="0" y="130" w="100%" h="PANEL_ALIGN" backgroundcolor="red" &gt;
      &lt;table id="TestPanel" x="1%" y="20" w="98%" h="PANEL_ALIGN""&gt;&lt;/table&gt;
        &lt;table id="TestPanel2" x="1%" y="20" w="98%" h="PANEL_ALIGN""&gt;&lt;/table&gt;
       &lt;/panel&gt;
  &lt;/panel&gt;
  </code></pre>
  
  <p>I use below xsl to remove table node but it removes all table node.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
   &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
   &lt;xsl:strip-space elements="*"/&gt;
  
   &lt;xsl:template match="node()|@*"&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:apply-templates select="node()|@*"/&gt;
    &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;
  
   &lt;xsl:template
   match="table"/&gt;
   &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Could anyone help , as i dont knwo much of xslt.</p>