Committed big changes to fix blatent bug in streaming namespace prefix declarations. It's still not perfect but it's vastly improved. It'll now make best efforts to declare namespaces as required. This is particularly useful if you serialising a subtree rather than a whole document. It's also useful if you've constructed the DOM by hand, rather than from a file.