def escape_html(val):
    """
    Applies appropriate escaping to the supplied value to allow it to be included in HTML element text.
    """
    # Also consider: 
    #   http://stackoverflow.com/questions/1061697/whats-the-easiest-way-to-escape-html-in-python
    return val.replace('<','&lt;').replace('>','&gt;')