Please suggest me.
This tags any selected text:
app.activeDocument.xmlElements.item(0).xmlElements.add ("subtitle", app.selection);
and adds this tag to the one containing the selection (despite adding it to the 'root' of the document). It seems not to care whether the selection already is tagged -- it always adds another one.