Fix reversibility

Taken PR from @yaccob - which allows reversibility of XML-to-JSON conversions