数値文字参照を文字に変換するPythonスクリプト

import re


def conv(s):
    cs = []
    for e in re.findall("&#x([0-9a-fA-F]+);", s):
        cs.append(chr(int(e, 16)))
    return "".join(cs)


def main():
    s = "ファイルまたはアセンブリ"
    print(conv(s)) # ファイルまたはアセンブリ


if __name__ == "__main__":
    main()

リンク

文字参照 - Wikipedia