'Handle a <field> node for a ManyToManyField.'

def _handle_m2m_field_node(self, node, field):

    if hasattr(field.rel.to._default_manager, 'get_by_natural_key'):
        def m2m_convert(n):
            keys = n.getElementsByTagName('natural')
            if keys:
                field_value = [getInnerText(k).strip() for k in keys]
                obj_pk = field.rel.to._default_manager.db_manager(self.db).get_by_natural_key(*field_value).pk
            else:
                obj_pk = field.rel.to._meta.pk.to_python(n.getAttribute('pk'))
            return obj_pk
    else:
        m2m_convert = (lambda n: field.rel.to._meta.pk.to_python(n.getAttribute('pk')))
    return [m2m_convert(c) for c in node.getElementsByTagName('object')]
