escape: imports at the top
escape: use xml.etree.ElementTree._escape_attrib to avoid duplication