public static function parseElementXml(SimpleXMLElement $xml){

        $attributes = array();
        foreach($xml->attributes() as $name => $value){
            $attributes[$name] = (string) $value;
        }

        $returnValue = array(
            'qtiClass' => $xml->getName()
        );

        if(count($attributes)){
            $returnValue['attributes'] = $attributes;
        }

        return $returnValue;
    }
public static function parseElementXml(SimpleXMLElement $xml){

        $attributes = array();
        foreach($xml->attributes() as $name => $value){
            $attributes[$name] = (string) $value;
        }

        $returnValue = array(
            'qtiClass' => $xml->getName()
        );

        if(count($attributes)){
            $returnValue['attributes'] = $attributes;
        }

        return $returnValue;
    }
public static function parseElementXml ( SimpleXMLElement $ xml ) { $ attributes = array ( ) ; foreach ( $ xml -> attributes ( ) as $ name => $ value ) { $ attributes [ $ name ] = ( string ) $ value ; } $ returnValue = array ( 'qtiClass' => $ xml -> getName ( ) ) ; if ( count ( $ attributes ) ) { $ returnValue [ 'attributes' ] = $ attributes ; } return $ returnValue ; }
Parse a generic QTI element node into an array

@param SimpleXMLElement $xml
@return array
Parse a generic QTI element node into an array