from bs4 import BeautifulSoup


def sanitise_xml(s):
    """
    Use BeautifulSoup to extract all text within HTML/XML tags, except those in <code> blocks.
    Remove the line breaks, replace unicode character for space
    
    Parameters
    ----------
    s - UTF-8 string
    
    Returns
    -------
    Cleaned up string    
    """
    soup = BeautifulSoup(s, 'lxml')
    for tag in soup.find_all('code'):
        tag.replace_with('')
        
    return soup.get_text().replace('\n', '').replace('\xa0', ' ')