protected function doWriteStartElement(string $elementName)
    {
        $this->append(
                function(\DOMNode $parent) use ($elementName)
                {
                    $element = $this->doc->createElement($elementName);
                    $parent->appendChild($element);
                    array_push($this->openElements, $element);
                },
                'start element: "' . $elementName . '"'
        );
    }