The generateXmlFiles hook is triggered when the XML files are (re)generated e.g.
by clicking “System » Maintenance » Recreate the XML files” in the back end.
It has no parameters and does not expect a return value.
Example
// src/EventListener/GenerateXmlFilesListener.php
namespaceApp\EventListener;useContao\CoreBundle\DependencyInjection\Attribute\AsHook;#[AsHook('generateXmlFiles')]
classGenerateXmlFilesListener{publicfunction__invoke():void{// Do something …
}}