Found an issue with namespaced elements and the parser.
Serializing now roughly follows 8.9 of the spec.

There are some namespace issues left to solve, but otherwise it
works.