I recently asked a question about an XML output that was wrong, this turned out to be because the namespace was put in an element.
Now I have looked further into this