Formation and quenching of XeF and KrF electronic excited states