The [[CSV Module]] provides a function for converting CSV to XML documents.
Documents can also be converted by specifying the parser in the query prologan XQuery function.
The following example query adds all CSV files that are located in the
directory {{Code|2Bimported}} to the database {{Code|DB}} and interprets
<pre class="brush:xquery">
declare option db:parser "csv";
declare option db:csvparser "header=yes";
for $file in file:list("2Bimported", false(), "*.csv")
return db:add('"DB'", $file, "", map { 'parser': 'csv', 'csvparser': map { 'header': true() }})
</pre>