protected function serializeScalarValue($value, XmlStreamWriter $xmlWriter, string $tagName = null): XmlStreamWriter
    {
        return $xmlWriter->writeStartElement(null === $tagName ? gettype($value) : $tagName)
                ->writeText(strval($value))
                ->writeEndElement();
    }