Convert XML to JSON object and to usable array of data

Maybe you will stumble upon some site or service that will still serve XML and not JSON. TO fix this to your most liked format use this on that XML string

$data = new SimpleXMLElement($request);
$data = drupal_json_decode(drupal_json_encode($data));

and you will have first JSON object and then standard drupal array of data to manipulate. This lines will also work
 

$data = simplexml_load_string($request);
$data = drupal_json_decode(drupal_json_encode($data));