add function to convert XML to JSON