Namespaces have scope within the element defining them
Containment structures
Namespace declarations are effective inside of the element where they were declared, unless another element overrides them. Making namespace declarations in the root element is therefore the easiest way to apply a namespace declaration to a document.
Immediate effects
Declarations made in the attributes of an element can affect the namespace of that very element: