XML to overlay generated band on top of RGB image

Hi! I’m using the “Layer Manager” to overlay an image generated with “Band Maths” on top of the RGB view of the product. Do you know if it is possible to obtain the XML script to automate this process (applying Band Maths, overlay the generated image on top of the RGB image and save it in some image format, like JPEG for example)?