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

@param   scalar                         $value
@param   \stubbles\xml\XmlStreamWriter  $xmlWriter  xml writer to write serialized value into
@param   string                         $tagName    name of the surrounding xml tag
@return  \stubbles\xml\XmlStreamWriter
serializes any scalar value to xml