def escapeToXml(text, isattrib = 0):
    text = text.replace("&", "&amp;")
    text = text.replace("<", "&lt;")
    text = text.replace(">", "&gt;")
    if isattrib == 1:
        text = text.replace("'", "&apos;")
        text = text.replace("\"", "&quot;")
    return text
Escape text to proper XML form, per section 2.3 in the XML specification.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/words/xish/domish.py/escapeToXml