public function getDocumentation($template = null)
    {
        if ($template === null) {
            $template = __DIR__.'/../../doc/templates/docclass.xsl';
        }
        if (!is_file($template)) {
            throw new WSException("Could not find the template file: '$template'");
        }
        $xtpl = new IPXSLTemplate($template);
        $documentation = array();
        $documentation['menu'] = array();
        //loop menu items
        $documentation['menu'] = $this->getClasses();

        if ($this->class) {
            if ($this->class->isUserDefined()) {
                $this->class->properties = $this->class->getProperties(false, false);
                $this->class->methods = $this->class->getMethods(false, false);
                foreach ((array) $this->class->methods as $method) {
                    $method->params = $method->getParameters();
                }
            } else {
                $documentation['fault'] = 'Native class';
            }
            $documentation['class'] = $this->class;
        }
        echo $xtpl->execute($documentation);
    }