Trying to reference namespace to the same xslt with document('') but I get :
 SystemID: file:/c:/intersystems/cache/mgr/samples/; Line#: 1; Column#: 1
net.sf.saxon.trans.XPathException: Error reported by XML parser
....
Caused by: org.xml.sax.SAXParseException; systemId: file:/c:/intersystems/cache/mgr/samples/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
So it seems can not reference the same xslt? Is there some way to do this
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:fn="http://www.w3.org/2005/xpath-functions" 
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" xmlns:csv="csv:csv">
<!-- <xsl:output method="text" version="4.0" encoding="iso-8859-1" indent="yes"/> -->
<xsl:strip-space elements="*" />
<xsl:output method="text" encoding="utf-8" />
<xsl:variable name="delimiter" select="','"/>
<csv:columns>
<column>GlobalID</column>
<column>ServicePointName</column>
</csv:columns>
  <xsl:template match="/Report">
        <!-- Output the CSV header -->
          ****<xsl:for-each select="document('')/*/csv:columns/*">****
                <xsl:value-of select="."/>
                <xsl:if test="position() != last()">
                    <xsl:value-of select="$delimiter"/>
                </xsl:if>
        </xsl:for-each> 
        <xsl:text>
</xsl:text>
        <!-- Output rows for each matched Report -->
        <xsl:apply-templates select="*" />
    </xsl:template>
    <xsl:template match="/Report/CLI">
            <xsl:for-each select="//CLI">
                        <xsl:value-of select="GlobalID"/>
                        <xsl:value-of select="$delimiter"/>
                        <xsl:value-of select="ServicePointName"/>
                        <!-- Add a newline at the end of the record -->
                        <xsl:text>
</xsl:text>
             </xsl:for-each>
     </xsl:template>
</xsl:stylesheet>