src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php
protected function generateNamespaceElements($namespaces, $parent_element, $node_name = 'namespace')
    {
        foreach ($namespaces as $name => $sub_namespaces) {
            $node = new \DOMElement($node_name);
            $parent_element->appendChild($node);
            $node->setAttribute('name', $name);
            $fullName = $parent_element->nodeName == $node_name
                ? $parent_element->getAttribute('full_name') . '\\' . $name
                : $name;
            $node->setAttribute('full_name', $fullName);
            $this->generateNamespaceElements($sub_namespaces, $node, $node_name);
        }
    }
protected function generateNamespaceElements($namespaces, $parent_element, $node_name = 'namespace')
    {
        foreach ($namespaces as $name => $sub_namespaces) {
            $node = new \DOMElement($node_name);
            $parent_element->appendChild($node);
            $node->setAttribute('name', $name);
            $fullName = $parent_element->nodeName == $node_name
                ? $parent_element->getAttribute('full_name') . '\\' . $name
                : $name;
            $node->setAttribute('full_name', $fullName);
            $this->generateNamespaceElements($sub_namespaces, $node, $node_name);
        }
    }
protected function generateNamespaceElements ( $ namespaces , $ parent_element , $ node_name = 'namespace' ) { foreach ( $ namespaces as $ name => $ sub_namespaces ) { $ node = new \ DOMElement ( $ node_name ) ; $ parent_element -> appendChild ( $ node ) ; $ node -> setAttribute ( 'name' , $ name ) ; $ fullName = $ parent_element -> nodeName == $ node_name ? $ parent_element -> getAttribute ( 'full_name' ) . '\\' . $ name : $ name ; $ node -> setAttribute ( 'full_name' , $ fullName ) ; $ this -> generateNamespaceElements ( $ sub_namespaces , $ node , $ node_name ) ; } }
Recursive method to create a hierarchical set of nodes in the dom.

@param array[]     $namespaces     the list of namespaces to process.
@param \DOMElement $parent_element the node to receive the children of
the above list.
@param string      $node_name      the name of the summary element.

@return void
Recursive method to create a hierarchical set of nodes in the dom .