protected function setNamespace($xml) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');

        $namespace = '';                    // default is the global namespace

        if (isset($xml['namespace'])) {
            $namespace = trim((string) $xml['namespace']);
            $namespace = str_replace('/', '\\', $namespace);

            if ($namespace == '\\') {
                $namespace = '';
            }
            else if (strlen($namespace)) {
                if (!$this->isValidNamespace($namespace)) throw new StrutsConfigException('<struts-config namespace="'.$xml['namespace'].'": Invalid module namespace');
                if (strStartsWith($namespace, '\\')) $namespace  = substr($namespace, 1);
                if (!strEndsWith($namespace, '\\'))  $namespace .= '\\';
            }
        }
        $this->imports[strtolower($namespace)] = $namespace;
    }