Python script making for XMP file generating when rendering

I am newbie on Unreal. I need to generate XMP files as well as JPEG files when rendering Movie render queue. I need a python script for it and need guide about how I can inject that python script