'Returns GML representation of the given field in a `gml` attribute
on each element of the GeoQuerySet.'

def gml(self, precision=8, version=2, **kwargs):

    backend = connections[self.db].ops
    s = {'desc': 'GML', 'procedure_args': {'precision': precision}}
    if backend.postgis:
        if (backend.spatial_version > (1, 3, 1)):
            procedure_fmt = '%(version)s,%(geo_col)s,%(precision)s'
        else:
            procedure_fmt = '%(geo_col)s,%(precision)s,%(version)s'
        s['procedure_args'] = {'precision': precision, 'version': version}
    return self._spatial_attribute('gml', s, **kwargs)
