static function methodsXSD( $server, $methods, $service_name='', $return_url=false )
    {
        $cachedir = eZSys::cacheDirectory() . '/webservices';
        // make sure our cache file names do not collide with wsdl ones (see methodsWSDL)
        $cachefilename = $cachedir . '/' . md5( "xsd,1," . implode( ',', $methods ) );
        $cachefile = eZClusterFileHandler::instance( $cachefilename );
        if ( $cachefile->exists() )
        {
            if ( $return_url )
            {
                $cachefile->fetch();
                return $cachefilename;
            }
            $wsdl = $cachefile->fetchContents();
        }
        else
        {
            //$wsdl_strings = array();
            $wsdl_functions = array();
            foreach ( $methods as $method )
            {
                $wsdl = $server->userWsdl( $method );
                if ( $wsdl == null )
                {
                    $sigs = $server->methodSignatures( $method );
                    $wsdl_functions[$method] = array(
                        //'name' => $function,
                        'params' => $sigs[0]['in'],
                        'returntype' => $sigs[0]['out'],
                        //'documentation' => $server->methodDescription( $method )
                    );
                }
            }

            // wsdl building is done via template
            $tpl = self::eZTemplateFactory();

            /// @todo !important we could build directly html output using an html template, to reduce resource usage
            //$namespace = 'webservices/wsdl/' . $service_name . '/types';
            //eZURI::transformURI( $namespace , false, 'full' );
            //$tpl->setVariable( 'namespace', $namespace );
            /// @todo we should use different service names if, depending on permissions, user cannot see all methods...
            //$tpl->setVariable( 'servicename', $service_name == '' ? 'SOAP' : ucfirst( $service_name ) );
            $tpl->setVariable( 'functions', $wsdl_functions );
            $wsdl = $tpl->fetch( "design:webservices/xsd.tpl" );

            if ( strlen( $wsdl ) )
            {
                $cachefile->storeContents( $wsdl );
            }
            else
            {
                $cachefilename = null; // used below as return value
            }
        }
        return $return_url ? $cachefilename : $wsdl;
    }