def process_attrib(element, msg):
        '''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.
        '''

        attrib_required = ['type', 'access', 'mandatory']
        for node in element.iter():
            for attrib in node.attrib.keys():
                if attrib not in attrib_required:
                    del node.attrib[attrib]
            if msg:
                node.attrib['diff'] = msg
        return element