code: def get_applicable_declarations(element, declarations):
      
      element_tag = element.tag
      element_id = element.get('id', None)
      element_classes = element.get('class', '').split()
  
      return [dec for dec in declarations
              if dec.selector.matches(element_tag, element_id, element_classes)]
docs: Given an XML element and a list of declarations, return the ones
          that match as a list of (property, value, selector) tuples.