working version for json to xml