XML to JSON converter in pure java code