'Get XML representation from self.
Overrides the base L{BaseError.getElement} to make sure the returned
element has a C{type} attribute and optionally a legacy C{code}
attribute.
@rtype: L{domish.Element}'

def getElement(self):

    error = BaseError.getElement(self)
    error['type'] = self.type
    if self.code:
        error['code'] = self.code
    return error
