Removes duplicate node elements from xml in js
function removeDuplates(){
var dup = {};
$('a').each(function() {
var txt = $(this).text();
if (dup[txt])
$(this).remove();
else
dup[txt] = true;
});
}