Refactoring to make $chunks variable global to the chunk.xsl stylesheet.