code: def xhtml_unescape(value: Union[str, bytes]) -> str:
      """Un-escapes an XML-escaped string.
  
      Equivalent to `html.unescape` except that this function always returns
      type `str` while `html.unescape` returns `bytes` if its input is `bytes`.
  
      .. versionchanged:: 6.4
  
         Now simply wraps `html.unescape`. This changes behavior for some inputs
         as required by the HTML 5 specification
         https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
  
         Some invalid inputs such as surrogates now raise an error, and numeric
         references to certain ISO-8859-1 characters are now handled correctly.
      """
      return html.unescape(to_unicode(value))
  
imports: import html
  import json
  import re
  import urllib.parse
  from tornado.util import unicode_type
  import typing
  from typing import Union, Any, Optional, Dict, List, Callable
label_desc: Use image node_id 2 for calling a global function with example usage: xhtml_unescape(value) and returns: html