Move creating XSLT templates code up.