Normalise use of apply-templates to always pick up text and elements. Restructure alert transformation