public function getElement(\DOMElement $nodeList, $level = 0, $showPaths = false)
    {
        $tabs = str_repeat("\t", $level);
        $output = '';
        if (!$showPaths) {
            $output = "";
            foreach ($nodeList as $attribute) {
                $output .= $tabs . $attribute->nodeName . " = " . $attribute->nodeValue . "\n";
            }

            $output .= $tabs . $nodeList->nodeName . " = " . $nodeList->nodeValue . "\n";
        } else {
            $output .= $nodeList->getNodePath() . "\n";
        }

        foreach ($nodeList->childNodes as $childObject) {
            if ($childObject instanceof \DOMElement) {
                $output .= $this->getElement($childObject, $level + 1, $showPaths);
            } elseif ($showPaths) {
                $output .= $childObject->getNodePath() . "\n";
            }
        }

        return $output;
    }
public function getElement(\DOMElement $nodeList, $level = 0, $showPaths = false)
    {
        $tabs = str_repeat("\t", $level);
        $output = '';
        if (!$showPaths) {
            $output = "";
            foreach ($nodeList as $attribute) {
                $output .= $tabs . $attribute->nodeName . " = " . $attribute->nodeValue . "\n";
            }

            $output .= $tabs . $nodeList->nodeName . " = " . $nodeList->nodeValue . "\n";
        } else {
            $output .= $nodeList->getNodePath() . "\n";
        }

        foreach ($nodeList->childNodes as $childObject) {
            if ($childObject instanceof \DOMElement) {
                $output .= $this->getElement($childObject, $level + 1, $showPaths);
            } elseif ($showPaths) {
                $output .= $childObject->getNodePath() . "\n";
            }
        }

        return $output;
    }
public function getElement ( \ DOMElement $ nodeList , $ level = 0 , $ showPaths = false ) { $ tabs = str_repeat ( "\t" , $ level ) ; $ output = '' ; if ( ! $ showPaths ) { $ output = "" ; foreach ( $ nodeList as $ attribute ) { $ output .= $ tabs . $ attribute -> nodeName . " = " . $ attribute -> nodeValue . "\n" ; } $ output .= $ tabs . $ nodeList -> nodeName . " = " . $ nodeList -> nodeValue . "\n" ; } else { $ output .= $ nodeList -> getNodePath ( ) . "\n" ; } foreach ( $ nodeList -> childNodes as $ childObject ) { if ( $ childObject instanceof \ DOMElement ) { $ output .= $ this -> getElement ( $ childObject , $ level + 1 , $ showPaths ) ; } elseif ( $ showPaths ) { $ output .= $ childObject -> getNodePath ( ) . "\n" ; } } return $ output ; }
Getter for retrieving all elements from a DIA object structure

@param \DOMElement $nodeList
@param integer     $level
@param boolean     $showPaths
@return string
Getter for retrieving all elements from a DIA object structure