When constructing a processing instruction, its target (name) cannot be the letters XML (in any combination of uppercase or lowercase letters). If you are attempting to add an XML declaration to your results, this is controlled by setting the omit-xml-declaration
serialization parameter to no
rather than being constructed in your query. Consult the documentation for your XQuery processor to determine how to set the serialization parameter (it varies by implementation).
18.217.164.143