Lots of variables being used to test existence of children before wrapping: much better to use xsl:where-populated!