Emit actual XML
Use less-arbitrary values for the namespace prefix assignment.

Alas, the data doesn't seem to round-trip properly: the output is
subtly different from the input (the namespace declarations are in
different places), and Chrome complains that it's not valid :-(