function &generate($element_context, &$global_elements)
 {
     $element_context[] = $this->getAttribute("name");
     print implode(",", $element_context) . "\n";
     // Get new factory
     $generator = new ElementMeta($global_elements);
     $generator->setIsAComplexType(true);
     // Load the class name and a context pre-fix (in case we're inside another element)
     $generator->setName($this->getAttribute('name'));
     $generator->setContext($element_context);
     // Extract any documentation for this node
     $a = $this->getElementsByType('xsAnnotation');
     if (count($a) > 0) {
         $d = $a[0]->getElementsByType('xsDocumentation');
         if (count($d) > 0) {
             $generator->setDocumentation($d[0]->get());
         }
     }
     if ($this->getAttribute('mixed') == 'true') {
         $generator->setMixed(true);
     }
     $content = $this;
     // Should only be one
     $this->generateComplexType($content, $generator, $element_context);
     if (count($generator->bag['elements']) == 0) {
         $generator->setIsEmptyContent(true);
     }
     $meta =& $generator->getMeta();
     if (count($element_context) == 1) {
         $global_elements[$element_context[0]] =& $meta;
     }
     return $meta;
 }