I\'m putting some page content (which has been run through Tidy, but doesn\'t need to be if this is a source of problems) into DOMDocument using DOMDocume
By definition, IDs are unique. If they are not, you should use classes instead (nor names, where it applies).
I doubt you can force XML tools to ignore duplicate IDs, that will make them handle an invalid XML document.