public static function XML2Array($xmlString)
    {
        try {
            $xml    = simplexml_load_string($xmlString, "SimpleXMLElement",
                LIBXML_NOCDATA);
            $json   = json_encode($xml);
            $result = json_decode($json, TRUE);
        } catch (\Exception $ex) {
            $result = '';
        }
        return $result;
    }
public static function XML2Array($xmlString)
    {
        try {
            $xml    = simplexml_load_string($xmlString, "SimpleXMLElement",
                LIBXML_NOCDATA);
            $json   = json_encode($xml);
            $result = json_decode($json, TRUE);
        } catch (\Exception $ex) {
            $result = '';
        }
        return $result;
    }
public static function XML2Array ( $ xmlString ) { try { $ xml = simplexml_load_string ( $ xmlString , "SimpleXMLElement" , LIBXML_NOCDATA ) ; $ json = json_encode ( $ xml ) ; $ result = json_decode ( $ json , TRUE ) ; } catch ( \ Exception $ ex ) { $ result = '' ; } return $ result ; }
Convert XML to array

@param string $xmlString
@return string
Convert XML to array