I am using the following code
String xml= "my xml"; JSONObject obj = XML.toJSONObject(xml)
to convert an xml string into json object.