def escape_quotes(value):
    """
    DTD files can use single or double quotes for identifying strings,
    so &quot; and &apos; are the safe bet that will work in both cases.
    """
    value = value.replace('"', "\\&quot;")
    value = value.replace("'", "\\&apos;")

    return value