The [[Database Functions#db:add|db:add()]] or [[Database Functions#db:replace|db:replace()]]
function can be used as well to add new XML documents to the database.
The following example query uses the internal parser and adds all files to the database <code>DB</code>that are found in the directory <code>2Bimported</code>:
<pre class="brush:xquery">
declare option db:intparse "yes";
for $file in file:list("2Bimported")
return db:add('DB', $file)