def decode(string):
    """Unescape string originating from XML
    
    :param string: string to decode
    :type: str
    :returns: decoded string
    :rtype: str
    """

    if '&#39;' not in string and '&quot;' not in string and '&lt;' not in string and '&gt;' not in string and '&amp;' not in string:  # already decoded
        return string

    string = string.replace('&#39;', "'")
    string = string.replace('&quot;', '"')
    string = string.replace('&lt;', '<')
    string = string.replace('&gt;', '>')
    string = string.replace('&amp;', '&')
    return string