simple javascript method to convert xml to json