The JSONiq extension to XQuery allows processing XML and JSON natively and with a single language. This extension is based on the same data model as the core JSONiq and is based on the same logical concepts. Because of the complexity of the XQuery grammar, the JSONiq extension to XQuery has a less pleasant syntax that the JSONiq core:
Object lookup is done with the same syntax as dynamic function calls (because the dot is allowed in variable names and XPath name tests).
All keys must be quoted (because unquoted strings are considered XPath name tests)
Escaping in strings is done the XML way, i.e., with ampersands instead of backslashes.
Builtin atomic types are actually builtin XML Schema types and must be prefixed with xs:
The item type syntax for structured items like object(), array(), json-item(), item() must use parentheses, as item types without parentheses are considered user-defined atomic types in XQuery.
The sequence type syntax for the empty sequence is empty-sequence().