Oddly, the XML namespace spec leaves un-prefixed attributes as
undefined behaviour, rather than inheriting the default namespace.
While fixing this, I've also made most of the output ignore local
aliases, because everyone should be using namespace URIs anyway.