'Generate an XForms form for the current resource
@param r: the S3Request
@param attr: controller parameters for the request'

def form(self, r, **attr):

    resource = self.resource
    form = S3XFormsForm(resource.table)
    response = current.response
    response.headers['Content-Type'] = 'application/xhtml+xml'
    return form
