title: XSLT Append to Result Document
body: <p>I have an XSLT script that I use for code generation where I process multiple input XML files, and output the files to Javascript code.  For each xml input file, I output one Javascript file.  </p>
  
  <p>So, I would have the following files/transformations occuring:</p>
  
  <pre><code>view1.xml -&gt; view1.js
  view2.xml -&gt; view2.js
  ...
  </code></pre>
  
  <p>Now I have a requirement to also create a one additional file during the XSL processing where I will need to append information regarding each input file processed to a common Javascript file.</p>
  
  <p>So, now I would have:</p>
  
  <pre><code>view1.xml -&gt; view1.js / append to common.js 
  view2.xml -&gt; view2.js / append to common.js
  ...
  </code></pre>
  
  <p>My question is, is it possible to append to a file during the processing of multiple input files?  I am currently using Saxon 9.1.0.7, and I looked at the xsl:result-document element, but this appears to overwrite any previously written content.</p>
  
  <p>Thanks.</p>