when application executes the stylesheet it will generate a seperate file each time. What I want is to generate multiple copies in the same file.added <xsl:apply-templates /> I got java.lang.NullPointerException because it reaches the end of XML file.Any better way to read from the beginning of the XML file again.Thanks.