def atomic_to_cim_xml(obj):
    """
    Convert an "atomic" scalar value to a CIM-XML string and return that
    string.

    The returned CIM-XML string is ready for use as the text of a CIM-XML
    'VALUE' element.

    Parameters:

      obj (:term:`CIM data type`, :term:`number`, :class:`py:datetime`):
        The "atomic" input value. May be `None`.

        Must not be an array/list/tuple. Must not be a :ref:`CIM object`.

    Returns:

        A :term:`unicode string` object in CIM-XML value format representing
        the input value. `None`, if the input value is `None`.

    Raises:

        TypeError
    """
    if obj is None:  # pylint: disable=no-else-return
        return obj
    elif isinstance(obj, six.text_type):
        return obj
    elif isinstance(obj, six.binary_type):
        return _to_unicode(obj)
    elif isinstance(obj, bool):
        return u'TRUE' if obj else u'FALSE'
    elif isinstance(obj, (CIMInt, six.integer_types, CIMDateTime)):
        return six.text_type(obj)
    elif isinstance(obj, datetime):
        return six.text_type(CIMDateTime(obj))
    elif isinstance(obj, Real32):
        # DSP0201 requirements for representing real32:
        # The significand must be represented with at least 11 digits.
        # The special values must have the case: INF, -INF, NaN.
        s = u'{0:.11G}'.format(obj)
        if s == 'NAN':
            s = u'NaN'
        elif s in ('INF', '-INF'):
            pass
        elif '.' not in s:
            parts = s.split('E')
            parts[0] = parts[0] + '.0'
            s = 'E'.join(parts)
        return s
    elif isinstance(obj, (Real64, float)):
        # DSP0201 requirements for representing real64:
        # The significand must be represented with at least 17 digits.
        # The special values must have the case: INF, -INF, NaN.
        s = u'{0:.17G}'.format(obj)
        if s == 'NAN':
            s = u'NaN'
        elif s in ('INF', '-INF'):
            pass
        elif '.' not in s:
            parts = s.split('E')
            parts[0] = parts[0] + '.0'
            s = 'E'.join(parts)
        return s
    else:
        raise TypeError(
            _format("Value {0!A} has invalid type {1} for conversion to a "
                    "CIM-XML string", obj, type(obj)))
Convert an "atomic" scalar value to a CIM-XML string and return that
    string.

    The returned CIM-XML string is ready for use as the text of a CIM-XML
    'VALUE' element.

    Parameters:

      obj (:term:`CIM data type`, :term:`number`, :class:`py:datetime`):
        The "atomic" input value. May be `None`.

        Must not be an array/list/tuple. Must not be a :ref:`CIM object`.

    Returns:

        A :term:`unicode string` object in CIM-XML value format representing
        the input value. `None`, if the input value is `None`.

    Raises:

        TypeError