re-instating workaround for PHP XML custom entity shortcomings