def unquote(txt): from xml.sax.saxutils import unescape return unescape(txt, {"'": "'", """: '"'})