Add namespaces to AST in the token handler, close self-closing tags