import re


def strip_comments(text: str) -> str:
    """Remove XML comments from a string.

    .. note::

        This will not remove lines that had comments, it only removes the text
        from "<!--" to "-->".

    :param text:
        XML text to strip comments from.

    :return:
        The given `text` without XML comments.
    """
    # thanks: https://stackoverflow.com/a/6806096
    return re.sub(r"(?s)<!--.*?-->", "", text)