'Test escaping XML special characters.'

def testXMLEscape(self):

    original = '<foo    bar="baz">\'Hi    &    welcome!\'</foo>'
    escaped = escape(original)
    desired = '&lt;foo    bar=&quot;baz&quot;&gt;&apos;Hi'
    desired += '    &amp;    welcome!&apos;&lt;/foo&gt;'
    self.failUnless((escaped == desired), ('XML    escaping    did    not    work:    %s.' % escaped))
