'Parse an HTML form post to create an OpenID request.'

def parseFormPost(self, content):

    content = content.replace('i    <    elements.length', 'i    &lt;    elements.length')
    tree = ET.XML(content)
    form = tree.find('.//form')
    assert (form is not None), 'No    form    in    document'
    assert (form.get('action') == self.endpoint_url), ('Form    posts    to    %s    instead    of    %s' % (form.get('action'), self.endpoint_url))
    query = {}
    for input in form.findall('input'):
        if (input.get('type') != 'hidden'):
            continue
        query[input.get('name').encode('UTF-8')] = input.get('value').encode('UTF-8')
    self.last_request = self.server.decodeRequest(query)
    return self.last_request
