==Output==
By default, all results will be returned with content type {{Code|application/xml}}. Similar to the [[REST#Content Type|REST]] interface, result serialization can be modified via [[XQuery 3.0#Serialization|XQuery 3.0 serialization parameters]]; in RESTXQ, serialization parameters may be specified in the query prolog, via annotations using the {{Code|output}} prefix, or within the queryREST response element. Global parameters are overwritten by more local parameters.
===Query Prolog===
</pre>
===QueryResponse===
The following example demonstrates how serialization parameters can be dynamically set within a query:
* <code>json</code> or <code>jsonml</code> → <code>application/json</code>
By default, {{Code|application/xml}} is returned as content type. In the following example, XHTML headers will be generated, and {{Code|text/html}} will be set as content type:
<pre class="brush:xquery">