Integrate XML File As Part of A Custom Language

I have a custom language plugin that needs to recognize some xml files as being part of the language. The XML can both define symbols in the language and include code from the custom language where I need to inject variables in the language injection block.

In addition to these things, I'd like to autodetect these XML files and include the language injections in them so the user doesn't have to go through them and apply the language injections themselves.

Does anyone have any advice?