The deploy script is executed on the HV nodes (by default the script is /var/tmp/one/vmm/kvm/deploy which is a copy of /var/lib/one/remotes/vmm/kvm/deploy on the front-end)
The domain XML is passed via stdin to the script and is saved to to the domain.X file:
So you have the domain XML in the $domain file. you could add code (the easiest is to call an external script with the $domain as argument) before
date=virsh --connect $LIBVIRT_URI create $domain…
Here is an example of tweaking the domain XML https://github.com/OpenNebula/addon-storpool/blob/master/vmm/kvm/vmTweakVirtioScsiMultiqueue.py it is sort of obsolete but could give an idea how to handle the changes.
As already said - you should add/edit files in /var/lib/one/remotes/ and then sync to the HVs (to update /var/tmp/one/…)