<?php
$xml = json_decode(json_encode((array) simplexml_load_string($string)), 1);
?>
A reminder that json_encode attempts to convert data to UTF-8 without specific knowledge of the source encoding. This method can cause encoding issues if you're not working in UTF-8.