How can I retrieve the XML source file name using XSL 1.0 code?
In XSLT 2.0, there are two relevant functions: base-uri() and document-uri().
In XSLT 1.0, you have to pass the URL or filename as a parameter to the stylesheet, unless the processor offers extension functions for the purpose.