def _encryption_config_from_xml(self, xml):
    parsed_xml = xmltodict.parse(xml)
    if ((not parsed_xml['ServerSideEncryptionConfiguration'].get('Rule')) or (not parsed_xml['ServerSideEncryptionConfiguration']['Rule'].get('ApplyServerSideEncryptionByDefault')) or (not parsed_xml['ServerSideEncryptionConfiguration']['Rule']['ApplyServerSideEncryptionByDefault'].get('SSEAlgorithm'))):
        raise MalformedXML()
    return [parsed_xml['ServerSideEncryptionConfiguration']]
def _encryption_config_from_xml(self, xml):
    parsed_xml = xmltodict.parse(xml)
    if ((not parsed_xml['ServerSideEncryptionConfiguration'].get('Rule')) or (not parsed_xml['ServerSideEncryptionConfiguration']['Rule'].get('ApplyServerSideEncryptionByDefault')) or (not parsed_xml['ServerSideEncryptionConfiguration']['Rule']['ApplyServerSideEncryptionByDefault'].get('SSEAlgorithm'))):
        raise MalformedXML()
    return [parsed_xml['ServerSideEncryptionConfiguration']]