public function addDomNode(\DOMNode $dom_node, $prepend=false)
    {
        if ($prepend) {
            array_unshift($this->nodes, $dom_node);
        } else {
            $this->nodes[] = $dom_node;
        }

        $this->length = \count($this->nodes);
        $this->setDomDocument($dom_node->ownerDocument);
    }