See
https://www.wowinterface.com/forums/...19&postcount=8 for more ...
Something like this should do the trick ...
Lua Code:
local f = CreateFrame("Frame", nil, self, BackdropTemplateMixin and "BackdropTemplate")
For xml-files I'd recommend to take a look at the new toc-change mentioned here ...
https://github.com/Stanzilla/WoWUIBu...ment-830351390
This way you can have different xml-files loaded by providing client-based toc files.