In 2012 Mark Nottingham wrote a blog post entitled "JSON or XML: Just Decide". It arguments that instead of trying to support both formats, web APIs should simply just use JSON. His advice seems to have been followed widely, as there are very few XML APIs left nowadays. However...
XQuery is a language that was originally developed as a DSL to query and transform XML documents. Since JSON has pushed XML aside as a data format on the web, the authors sought to support other data structures as well: JSON-like arrays and maps. This was realized in XQuery version 3.1, and a recommendation candidate was published in 2015. I know what you're thinking: too bad, too late, and against MNot's advice. This would indeed be my TL;DR, but just let me elaborate a bit more...
Although not the first inconsistencies in XQuery (consider the higher-order function notation, for example), function items are a blemish upon the "immaculate" datamodel and performance concerns. But more than anything else, they open Pandora's Box, or rather, a means for XQuery to break out of the DSL and try to do stuff formerly reserved for general-purpose programming languages. Sure enough, smart developers have always found ways to work around the intentional limitations of XML tools, but still... maps and arrays have allowed me to parse, serialize and execute XQuery and XSLT within XQuery! Parsing speed is of course hampered by the implementation's performance characteristics, but this goes to demonstrate that it can be done, and that XQuery has grown out of its DSL boundaries.
So what about modifying "JSON" data in XQuery? XML fragments are simply recreated, but most implementations can optimize this process somewhat behind the scenes. However, doing this with maps and arrays straightforwardly would be a performance disaster! For XML documents there's also the XUpdate extension to XQuery, but again inconsistent and not for JSON.
To conclude, JSON is a latecomer in XQuery, very likely too late. Had the focus been on developing a more intuitive syntax for handling maps and arrays, the W3C XQuery Working Group could have had the answer for creating JSON in the best possible way, pouring years of knowledge on treating hierarchical data into a solid model. As it now stands, the feature is a half-hearted attempt to save the language from its impending demise.