Bugfix: Put closing XML tags in correct order