title: XQuery file:write only writes one line
body: <p>I would like the below query to write the results to an xml file. Currently it only writes the first element of the result into the xml file, regardless of how many elements there are. </p>
  
  <p>Why is this happening and how can I fix it?</p>
  
  <pre><code>let $fName := "C:\Users\user\Documents\Sitemaps\Updated Pages\Books.xml"
  
  for $x in doc("http://www.w3schools.com/xsl/books.xml")/bookstore/book
  where $x/price&gt;0
  return file:write($fName,$x/title)
  </code></pre>