If 400+ domains exist it's not possible to Execute App Defaults without getting PHP out of memory error on line 630 in 'app\dialplan\resources\classes\dialplan.php'.
It would be better to first build XML for each domain_name (context) then for all else.