DOM is irrelevant, what matters is XML. Libxml2 does not implement DOM.
If you're discussing about whether an API allows somthings in a memory
tree, then that's not XML, it's irrelevant. If you are discussing about
how an instance looks like, then XML is a normative prose which tells
what is flawed and what is not.
Your example had a serialization without the xmlns, so there is no namespace
from an XML perspective. Anything else is discussions about implementations,
are implementation specific and not normative from my point of view.