public function addComplexType($name, $typeClass = 'complexType', $phpType = 'array', $compositor = '', $restrictionBase = '', $elements = array(), $attrs = array(), $arrayType = '')
    {
        if (count($elements) > 0) {
            $eElements = array();
            foreach ($elements as $n => $e) {
                // expand each element
                $ee = array();
                foreach ($e as $k => $v) {
                    $k = strpos($k, ':') ? $this->expandQname($k) : $k;
                    $v = strpos($v, ':') ? $this->expandQname($v) : $v;
                    $ee[$k] = $v;
                }
                $eElements[$n] = $ee;
            }
            $elements = $eElements;
        }

        if (count($attrs) > 0) {
            foreach ($attrs as $n => $a) {
                // expand each attribute
                foreach ($a as $k => $v) {
                    $k = strpos($k, ':') ? $this->expandQname($k) : $k;
                    $v = strpos($v, ':') ? $this->expandQname($v) : $v;
                    $aa[$k] = $v;
                }
                $eAttrs[$n] = $aa;
            }
            $attrs = $eAttrs;
        }

        $restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
        $arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;

        $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
        $this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
    }