Fix reversibility

Ported @jaccob change for JSON-XML reversible conversions