decorator that allows us to match by expression or by xpath for each transformation method

def match(self, expression=None, xpath=None, namespaces=None): 
        """decorator that allows us to match by expression or by xpath for each transformation method"""
        class MatchObject(Dict):
            pass
        def _match(function):
            self.matches.append(
                MatchObject(expression=expression, xpath=xpath, function=function, namespaces=namespaces))
            def wrapper(self, *args, **params):
                return function(self, *args, **params)
            return wrapper
        return _match