If system finds a duplicate , it should eliminate both nodes altogether. I have original xml as:
<?xml version="1.0" encoding="utf-8"?>
<RESPONSE>
<RECORD>
<COUNTRY_ID>2111</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2121</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2211</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2221</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3111</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3121</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3211</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3221</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2111</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2121</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2211</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2221</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2311</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2321</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3111</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3121</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3211</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3221</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3311</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3321</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4111</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4121</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4211</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4221</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4311</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4321</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
</RESPONSE>
and the desired output should be below:
<?xml version="1.0" encoding="utf-8"?>
<RESPONSE>
<RECORD>
<COUNTRY_ID>2311</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>2321</COUNTRY_ID>
<CITY id="2:">0</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3311</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>3321</COUNTRY_ID>
<CITY id="3:">30</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4111</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4121</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="1:14404388">LA11CFTXX</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4211</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4221</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="2:14048042">LAZ1129YY</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4311</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="1:">1</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
<RECORD>
<COUNTRY_ID>4321</COUNTRY_ID>
<CITY id="4:">100</CITY>
<LOCATION id="3:14048629">LAZ11B91AA</LOCATION>
<REPID id="2:">2</REPID>
<FLIGHTID id="1:1091513">ALK</FLIGHTID>
</RECORD>
</RESPONSE>
can we able to write an xsl to do this?
thanks