Hi, I am trying to output XML with a link to a RelaxNG schema without success. - It works with DTDs using doctype-public and doctype-systems in the serialization params of file:write - It works with .xsd because the declaration is in the attribute - For relaxNg, the intro line looks like a PI, but I can't seem to be able to keep PIs when outputting xml with file:write Specifically: let $map-params := map { 'method': 'xml', 'indent': 'no', 'omit-xml-declaration': 'no' } let $map := ( <?xml-model href="urn:oasis:names:tc:dita:rng:map.rng" schematypens="http://relaxng.org/ns/structure/2.x"?>, <map> <?test name="abc"?> <title>{lower-case($spez/child::*[name()='name']/text())}</title>{ <title>{lower-case($spez/child::*[name()='name']/text())}</title>{ ... }</map> ) return file:write($dir-path || '/spec-' || lower-case($spez/child::*[name()='name']/text()) || '.ditamap', $map) gets me: <map> <title>Tests for elements - version 2.0</title> ... </map> Both the declaration and the in-content test pi disappear. What am I missing here? -- France Baril Architecte documentaire / Documentation architect france.baril@architextus.com