When a call to concat() forms the body of an XSLT template (typically within xsl:sequence) then it may be evaluated in "push" mode: the idea is that instead of forming the concatenated string and writing that to the serialized output of the transformation, each of the arguments is evaluated and sent to the serializer separately. However, this optimization is only safe when the template results are indeed being serialized, or when they are being used to form the complex content of a constructed element or document node, or the simple content of a node such as an attribute. If the results of the template containing the call to concat() are used in some other way, then instead of a single string being returned, a sequence is returned containing (a) a zero-length string, (b) a sequence of text nodes, one per argument of the concat() call, and (c) another zero-length string.
A patch is being raised to detect at run-time whether the destination of the output is a ComplexContentOutputter, and disable the optimization otherwise. This is not a perfect solution, but it is safe.