Where are the device provisioner generic xml templates located?

Hello,

They are located in:
/var/www/fusionpbx/resources/templates/provision/

The same applies for github location:

Github

If you are making changes, I'd advise to copy the original template to a new one and edit that one as updates might fail if you alter the original.
You would then have to use git stash if it does.
You also have in the Default Settings - Provision some settings you can change for specific Vendors.
 
For FS PBX, the templates are located here:

Code:
/var/www/fspbx/public/resources/templates/provision/

As far as your error goes, it's due to a memory issue. You need 4 GB of RAM to compile the files. This is per your first screenshot. The second screenhowt only has warnings that can be ignored.