PHP class to flatten an XML file into a PHP associative array