saxon:print-stack()

saxon:print-stack() ==> xs:string

This function takes no arguments. It returns a string whose value is a formatted representation of the current state of the execution stack. This is suitable for display using xsl:message or the trace() function, or it can be inserted as a comment into the result document.