There were some whitespace differences between those two examples that make them NOT equal. Assuming that those were just formatting mistakes when posting the document and the question is really about the difference in the namespace-prefix, then yes they are equal.
You can use the function fn:deep-equal()
to test. Below is an XQuery example:
let $a :=
<animals>
<animals:dog xmlns:animals="urn:animals">
The dog was the first species to be domesticated
</animals:dog>
</animals>
let $b :=
<animals>
<tiere:dog xmlns:tiere="urn:animals">
The dog was the first species to be domesticated
</tiere:dog>
</animals>
return
fn:deep-equal($a, $b)
Should anyone care what namespace-prefix is used in an instance document? 99.99% of the time, no. If they are using proper tooling and XML APIs, it will not matter. You address elements by their QName, and as long as the namespace and the local-name are correct, it doesn't matter which namespace-prefix was used.
If they are string parsing angle brackets and the namespace-prefix causes problems, then they are doing something wrong and should fix their program.