I don't understand, why does this add-on changes the resource icon from other ways than the template function ?
It's the add-on itself that is not done the right way.
The add-on should overlad the existing resource_icon function, not create a new function xm_icon.