def encode_to_xml(text: str) -> str:
    """
    Encodes ampersand, greater and lower characters in a given string to HTML-entities.
    """
    text_str = str(text)
    text_str = text_str.replace('&', '&amp;')
    text_str = text_str.replace('<', '&lt;')
    text_str = text_str.replace('>', '&gt;')

    return text_str