def translate_map_from_xml(soup):
    """Generate a translate map between unicode and "2 byte sequence" or vice versa,
    using 'gb-18030-2000.xml' from 'icu-project'.
    
    Returns: dict(multibyte -> unicode), dict(unicode -> multibyte)
    
    ref) https://en.wikipedia.org/wiki/GB_18030
    ref) http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
    """

    int16 = lambda x: int(x[0], 16) * 256 + int(x[1], 16) if len(x) == 2 else int(x[0], 16)
    mapping = [(int(a['u'], 16),
                int16(a['b'].split()))
               for a in soup.findAll('a') if len(a['b']) < 8]
    return dict((i[1],i[0]) for i in mapping), dict((i[0],i[1]) for i in mapping)