[xml/json] Fix accidental code removal in b1c6145e9

b1c6145e9 accidentally removed some code from 9acad203 due to a failed
git pull.  This restores those pieces which were removed.
Merge branch 'master' into stage-merge