'Export a combined tree of all records in tables, which
are in Lx, and have been updated since msince.
@param tables: list of table names
@param msince: minimum modified_on datetime, "auto" for
automatic from feed data, None to turn it off
@param update_feed: update the last_update datetime in the feed'

def export_combined_tree(self, tables, msince=None, update_feed=True):

    db = current.db
    s3db = current.s3db
    ftable = s3db.gis_poi_feed
    lx = self.lx
    elements = []
    for tablename in tables:
        try:
            resource = s3db.resource(tablename, components=[])
        except AttributeError:
            continue
        if ('location_id' not in resource.fields):
            continue
        self._add_lx_filter(resource, lx)
        query = ((ftable.tablename == tablename) & (ftable.location_id == lx))
        feed = db(query).select(limitby=(0, 1)).first()
        if (msince == 'auto'):
            if (feed is None):
                _msince = None
            else:
                _msince = feed.last_update
        else:
            _msince = msince
        tree = resource.export_tree(msince=_msince, references=['location_id'])
        if update_feed:
            muntil = resource.muntil
            if (feed is None):
                ftable.insert(location_id=lx, tablename=tablename, last_update=muntil)
            else:
                feed.update_record(last_update=muntil)
        elements.extend([c for c in tree.getroot()])
    tree = current.xml.tree(elements, results=len(elements))
    return tree
