You can read documents using the document() function and in XSLT you can write them using the xsl:result-document instruction. But generally you will invoke an XSLT transformation from a host application, and the host application will be responsible for obtaining the input and disposing of the output. As I said before, consult the API documentation for your chosen product.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference