'Encode, send and process the request to the Authorize.net API.
Encodes the xml data and process the response. Note that only a basic
processing is done at this level (namespace cleanup, basic error management).
:param etree._Element data: etree data to process'

def _authorize_request(self, data):

    data = etree.tostring(data, xml_declaration=True, encoding='utf-8')
    request = Request(self.url, data)
    request.add_header('Content-Type', 'text/xml')
    response = urlopen(request).read()
    response = strip_ns(response, XMLNS)
    if (response.find('messages/resultCode').text == 'Error'):
        messages = map((lambda m: m.text), response.findall('messages/message/text'))
        raise ValidationError((_('Authorize.net    Error    Message(s):\n    %s') % '\n'.join(messages)))
    return response
