New common function: addTagEntry()