def xsd_datetime_str_from_dt(dt):
    """Format datetime to a xs:dateTime string.

    Args:
      dt : datetime

        - tz-aware: Used in the formatted string.
        - tz-naive: Assumed to be in UTC.

    Returns:
      str
        The returned format can be used as the date in xs:dateTime XML elements. It
        will
        be on the form ``YYYY-MM-DDTHH:MM:SS.mmm+00:00``.

    """
    return dt.strftime("%Y-%m-%dT%H:%M:%S.%f+00:00")