'Get XML representation from self.
The method creates an L{domish} representation of the
error data contained in this exception.
@rtype: L{domish.Element}'

def getElement(self):

    error = domish.Element((None, 'error'))
    error.addElement((self.namespace, self.condition))
    if self.text:
        text = error.addElement((self.namespace, 'text'), content=self.text)
        if self.textLang:
            text[(NS_XML, 'lang')] = self.textLang
    if self.appCondition:
        error.addChild(self.appCondition)
    return error
