Explicitly set priority on XSLT templates
Clean chunking code for clarity