@staticmethod<EOL><INDENT>def process_attrib(element, msg):<DEDENT>
attrib_required = ['<STR_LIT:type>', '<STR_LIT>', '<STR_LIT>']<EOL>for node in element.iter():<EOL><INDENT>for attrib in node.attrib.keys():<EOL><INDENT>if attrib not in attrib_required:<EOL><INDENT>del node.attrib[attrib]<EOL><DEDENT><DEDENT>if msg:<EOL><INDENT>node.attrib['<STR_LIT>'] = msg<EOL><DEDENT><DEDENT>return element<EOL>
process_attrib

        High-level api: Delete four attributes from an ElementTree node if they
        exist: operation, insert, value and key. Then a new attribute 'diff' is
        added.

        Parameters
        ----------

        element : `Element`
            A node needs to be looked at.

        msg : `str`
            Message to be added in attribute 'diff'.

        Returns
        -------

        Element
            Argument 'element' is returned after processing.