<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_node_set(self, element, decl, pseudo):
 """Implement node-set declaration."""

        target = serialize(decl.value).strip()
        step = self.state[self.state['current_step']]
        elem = self.current_target().tree
        _, valstep = self.lookup('pending', target)
        if not valstep:
            step['pending'][target] = [('nodeset', elem)]
        else:
            self.state[valstep]['pending'][target] = [('nodeset', elem)]