def with_peer(events):
stack = []<EOL>for obj in events:<EOL><INDENT>if obj['<STR_LIT:type>'] == ENTER:<EOL><INDENT>stack.append(obj)<EOL>yield obj, None<EOL><DEDENT>elif obj['<STR_LIT:type>'] == EXIT:<EOL><INDENT>yield obj, stack.pop()<EOL><DEDENT>else:<EOL><INDENT>yield obj, None<EOL><DEDENT><DEDENT>
locates ENTER peer for each EXIT object. Convenient when selectively
    filtering out XML markup