Generate theme.xml after export theme hooks

Related: #7341

If `$xml` gets modfied in the `exportTheme` hook, the changes should be saved to the theme.xml file.