code: def is_valid(self, name=None, debug=False):
          
          valid_tags = self.action_tree
          invalid = False
          for item in self.current_tree:
              try:
                  if item in valid_tags or self.ALL_TAGS in valid_tags:
                      valid_tags = valid_tags[item if item in valid_tags else self.ALL_TAGS]
                  else:
                      valid_tags = None
                      invalid = True
                      break
              except (KeyError, TypeError) as e:  # object is either missing the key or is not a dictionary type
                  invalid = True
                  break
          if debug:
              print name, not invalid and valid_tags is not None
          return not invalid and valid_tags is not None
docs: Check to see if the current xml path is to be processed.