That right there is why I like Clark's notation (despite its unholy verbosity), which I learned of because that's how ElementTree manipulates namespaces: in Clark's notation, the document is conceptually
<{https://sample.com/1}tag>
<{https://blah.org/1}tag>
<{https://blah.org/2}tag>
<{https://anewsite.com/xmlns}tag />
</{https://blah.org/2}tag>
</{https://blah.org/1}tag>
</{https://sample.com/1}tag>
Which is unambiguous. But as you note adds challenges for round-trip equality (in fact ElementTree doesn't maintain that, it simply discards the namespace prefixes on parsing, which I have seen outright break supposedly XML parsers which were really hard-coded for specific namespace prefixes).lxml does round-trip prefixes (though it still doesn't round-trip documents) by including a namespace map on each element.