Functions and mappings to close open HTML/XML tags