I've created an xquery file (see below) which generates a teiCorpus
document from a collection of TEI files. I've also created a TEI
customization. Is there a way to have xquery or eXist insert an <?xml-model
?> statement at the head of the corpus document, with the URL pointing to
my TEI customization RNG file? I've noticed that inside the corpus file,
these xml-model statements appear before every TEI element.


Joe Easterly
Digital Humanities Librarian
University of Rochester River Campus Libraries

*xquery version *"3.0";
*declare default element namespace *"";
*declare option **exist:serialize* "method=xml media-type=text/xml";
*declare variable **$collection* := *collection*('/db/mcelroy/tei');

|TITLE Corpus Generator for Nellie McElroy Ledgers
|CREATOR Joe Easterly
|UPDATED 2018-05-30
|DESCRIPTION This script collects TEI files from the Nellie McElroy ledgers
into a corpus file.
|LICENSE This work is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International
         License. To view a copy of this license, visit
                <title>Nellie McElroy Ledger</title>
                <p>Released by the University of Rochester River Campus
                <p>Nellie L McElroy Journal, 1913-1916. Manuscript
Collection CY.21. Journal of work
                    as Rochester's first policewoman.</p>
        *for **$collItem* *in **$collection*
        *let* *$page* := *base-uri*(*$collItem*)