// Writes a string into the XML stream
        private void WriteString(NameInfo memberNameInfo, NameInfo typeNameInfo, object stringObject)
        {
            bool isFirstTime = true;

            long stringId = -1;

            if (!CheckTypeFormat(_formatterEnums._typeFormat, FormatterTypeStyle.XsdString))
            {
                stringId = InternalGetId(stringObject, false, null, out isFirstTime);
            }
            typeNameInfo._objectId = stringId;

            if ((isFirstTime) || (stringId < 0))
            {
                _serWriter.WriteMemberString(memberNameInfo, typeNameInfo, (string)stringObject);
            }
            else
            {
                WriteObjectRef(memberNameInfo, stringId);
            }
        }