The Emacs function sgml-tag is just what I need for my DocBook editing. However, I edit DocBook in nXml mode and I can't seem to find an alternative. sgml-tag still works fine, but does not offer XML tags. My use case is:
highlight a region, press a shortcut, minibuffer asks for an XML tag, I write e.g. "scre RET", region is surrounded with the screen tag
If there are more alternatives to my incomplete tag e.g. para, paramdef for "pa", TAB shows all options. Basically, just like sgml-tag.
Thanks for help!
The nxml alternative by default is to go to start of region enter <scre C-RET
to complete the start tag, then C-xC-x to move to the other end of the region and C-f to close the open element.
It would be easy enough to wrap that in a bit of emacs list or a keyboard macro, but actually it works quite well just having the components of the operation separate as they are individually useful.