def endElement(self, name, value, connection):
    if (name == 'TotalResults'):
        self.total_results = value
    elif (name == 'TotalPages'):
        self.total_pages = value
    elif (name == 'IsValid'):
        if (value == 'True'):
            self.is_valid = True
    elif (name == 'Code'):
        self.errors.append({'Code': value, 'Message': None})
    elif (name == 'Message'):
        self.errors[(- 1)]['Message'] = value
    elif (name == 'Item'):
        self.objs.append(self.curItem)
        self._xml.write(self.curItem.to_xml())
        self.curItem = None
    elif (self.curItem is not None):
        self.curItem.endElement(name, value, connection)
    return None
def endElement(self, name, value, connection):
    if (name == 'TotalResults'):
        self.total_results = value
    elif (name == 'TotalPages'):
        self.total_pages = value
    elif (name == 'IsValid'):
        if (value == 'True'):
            self.is_valid = True
    elif (name == 'Code'):
        self.errors.append({'Code': value, 'Message': None})
    elif (name == 'Message'):
        self.errors[(- 1)]['Message'] = value
    elif (name == 'Item'):
        self.objs.append(self.curItem)
        self._xml.write(self.curItem.to_xml())
        self.curItem = None
    elif (self.curItem is not None):
        self.curItem.endElement(name, value, connection)
    return None