public static function attributeOutputData( ezpContentField $field )
    {
        // @TODO move to datatype representation layer
        switch ( $field->data_type_string )
        {
            case 'ezxmltext':
                $html = $field->content->attribute( 'output' )->attribute( 'output_text' );
                $attributeValue = array( strip_tags( $html ) );
                break;
            case 'ezimage':
                $strRepImage = $field->toString();
                $delimPos = strpos( $strRepImage, '|' );
                if ( $delimPos !== false )
                {
                    $strRepImage = substr( $strRepImage, 0, $delimPos );
                }
                $attributeValue = array( $strRepImage );
                break;
            default:
                $datatypeBlacklist = array_fill_keys(
                    eZINI::instance()->variable( 'ContentSettings', 'DatatypeBlackListForExternal' ),
                    true
                );
                if ( isset ( $datatypeBlacklist[$field->data_type_string] ) )
                    $attributeValue = array( null );
                else
                    $attributeValue = array( $field->toString() );
                break;
        }

        // cleanup values so that the result is consistent:
        // - no array if one item
        // - false if no values
        if ( count( $attributeValue ) == 0 )
        {
            $attributeValue = false;
        }
        else if ( count( $attributeValue ) == 1 )
        {
            $attributeValue = current( $attributeValue );
        }

        return array(
            'type'                  => $field->data_type_string,
            'identifier'            => $field->contentclass_attribute_identifier,
            'value'                 => $attributeValue,
            'id'                    => (int)$field->id,
            'classattribute_id'     => (int)$field->contentclassattribute_id
        );
    }