Addons: Trying to clean up some variable mess on xmltagging

I've tried to clean up the xmltagging function a bit