public function writeXmlFragment(string $fragment): XmlStreamWriter
    {
        return $this->append(
                function(\DOMNode $parent) use ($fragment)
                {
                    $fragmentNode = $this->doc->createDocumentFragment();
                    $fragmentNode->appendXML($fragment);
                    @$parent->appendChild($fragmentNode);
                },
                'document fragment'
        );
    }