To merge elements and not to have any duplicates I use XPath to compare if 2 ```NodeElements``` are equal.