In XSLT 2.0 (Saxon):
<xsl:template name="main">
<xsl:apply-templates select="collection('file://c:/temp/?select=*.xml')"/>
</xsl:template>
<xsl:template match="/">
<xsl:result-document href="{document-uri(.)}.out">
<xsl:apply-templates/>
</xsl:result-document>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="book">
<xsl:next-match/>
new line 1
new line 2
new line 3
</xsl:template>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference