private function createElementWithComplexType($name, $elements)
    {
        //print_r('Create complex type '.$name."\n");
        $el = $this->dom->createElement($this->xmlSchemaPreffix.':element');
        $el->setAttribute('name', $name);
        
        $compType = $this->dom->createElement($this->xmlSchemaPreffix.':complexType');
        $seqType = $this->dom->createElement($this->xmlSchemaPreffix.':sequence');
        
        foreach ($elements as $element) {
            $seqType->appendChild($element);
        }
        
        $compType->appendChild($seqType);
        $el->appendChild($compType);
        
        return $el;
    }