Replace opening tag with closing tag