I seem to be finding this surprisingly difficult.
take an array, and return a sequence (obviously sequences in the array will be flattened)
I’ve tried this
<xsl:function name="kooks:toSequence" as="item()*">
<xsl:param name="array" as="array(item()*)"/>
<xsl:sequence select="array:fold-left($array,(),function($state,$head) { ($state,$head) })"/>
</xsl:function>
it works, but this seems to be overkill, and as I don’t know how the operator ‘,’ is implemented in a sequence, its concerns me that this is o(n*n).
array:flatten wont work, because it will flatten any arrays in the entries.