I have couple of XML files that contain lots of duplicate entries, such as these.
If your duplicates are always in this form, then you could do this with a bit of XSLT to remove duplicate nodes. The XSLT for this is:
If it's something that can happen frequently, then it might be worth having that stylesheet loaded into a XslCompiledTransform instance.
Or you can simply get a list of all duplicate nodes using this XPath:
/annotations/annotation/image[@location = preceding-sibling::image/@location]
and remove them from their parent.