===JSON Functions===
XQuery now provides native support for JSON objects. Objects can be parsed to XQuery items and serialized back to their original form.
====fn:parse-json====
<pre class="brush:xquery">
json-doc("http://ip.jsontest.com/")('ip') (: returns your IP address :)
</pre>
====Serialization====
{{Mark|Warning}}: BaseX has been using the {{Code|json}} output method for a while. With BaseX 8.0, the implementation of this method will be rewritten to comply with the new standard serialization rules. We will do our best to keep the updated code backward-compatible.
<pre class="brush:xquery">
(: will return { "key": "value" } :)
declare option output:method 'json';
map { "key": "value" }
</pre>