code: def _add_notification_config_to_xml(node, element_name, configs):
      
      for config in configs:
          config_node = s3_xml.SubElement(node, element_name)
  
          if 'Id' in config:
              id_node = s3_xml.SubElement(config_node, 'Id')
              id_node.text = config['Id']
  
          arn_node = s3_xml.SubElement(
              config_node,
              NOTIFICATIONS_ARN_FIELDNAME_MAP[element_name]
          )
          arn_node.text = config['Arn']
  
          for event in config['Events']:
              event_node = s3_xml.SubElement(config_node, 'Event')
              event_node.text = event
  
          filter_rules = config.get('Filter', {}).get(
              'Key', {}).get('FilterRules', [])
          if filter_rules:
              filter_node = s3_xml.SubElement(config_node, 'Filter')
              s3key_node = s3_xml.SubElement(filter_node, 'S3Key')
              for filter_rule in filter_rules:
                  filter_rule_node = s3_xml.SubElement(s3key_node, 'FilterRule')
                  name_node = s3_xml.SubElement(filter_rule_node, 'Name')
                  name_node.text = filter_rule['Name']
                  value_node = s3_xml.SubElement(filter_rule_node, 'Value')
                  value_node.text = filter_rule['Value']
      return node
docs: Internal function that builds the XML sub-structure for a given
      kind of notification configuration.