def get(self, namespace, elemid):
        """Implement a 'GET' operation.

        For a way:
        - Return the way itself,
        - Return the full XML of all nodes referenced by the
          way.
        For a relation:
        - Return the relation itself,
        - All nodes and ways that are members of the relation.
        - All nodes referenced from the ways above.
        """

        # Retrieve the element.
        element = self.datastore.fetch(namespace, elemid)
        if element is None:
            raise tornado.web.HTTPError(404)

        nodes = []
        ways = []
        relations = []

        if namespace == C.RELATION:
            # Retrieve nodes directly referenced by the relation.
            nodeset = element.get_member_ids(C.NODE)
            nodes.extend([z for (st,z) in
                          self.datastore.fetch_keys(C.NODE, [n for n in nodeset])
                          if st])
            # Retrieve way IDs directly referenced by the relation.
            wayset = element.get_member_ids(C.WAY)
            # Include the relation itself.
            relations.append(element)
        else:
            nodeset = set()
            wayset = set([elemid])

        # Fetch all ways.
        if len(wayset) > 0:
            ways.extend([z for (st, z) in
                         self.datastore.fetch_keys(C.WAY, [w for w in wayset])
                         if st])

        # Fetch additional nodes referenced by the ways in the
        # way set.
        additional_nodes = set()
        for w in ways:
            additional_nodes.update(w.get_node_ids())

        additional_nodes = additional_nodes - nodeset
        nodes.extend([z for (st, z) in
                      self.datastore.fetch_keys(C.NODE, [n for n in additional_nodes])
                      if st])

        # Build and return a response.
        osm = new_osm_response()
        for n in nodes:
            n.build_response(osm)
        for w in ways:
            w.build_response(osm)
        for r in relations:
            r.build_response(osm)

        self.set_header(C.CONTENT_TYPE, C.TEXT_XML)
        self.write(response_to_xml(osm))
dataset/ETHPy150Open MapQuest/mapquest-osm-server/src/python/frontend/osmelement.py/OsmFullQueryHandler.get/original