This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The section https://www.w3.org/TR/2017/PR-xpath-functions-31-20170117/#func-xml-to-json has the last paragraph saying The input <map xmlns="http://www.w3.org/2005/xpath-functions"><number key="Sunday">1</number><number key="Monday">2</string></map> produces the result {"Sunday":1,"Monday":2}. That markup is not well-formed, it should be <number key="Monday">2</number> for the second child element.
Thank you. Corrected in both the F+O and XSLT versions of the spec.