I do not really like the following solution, but I studied your problem a bit because I could not think of a simple solution:
func! GetTag() call inputsave() let g:tagName = input("Tag: ") call inputrestore() endfunc imap \t <esc>:call GetTag()<CR>:exe "normal! i<".tagName."></".tagName.">"<CR>bba
It should work fine, you can read the docs here (see the last example). By the way, if you plan to write a lot of XML or HTML, I would suggest you take a look at the following plugins:
They will save you a lot of information.
source share