@staticmethod
def from_xml(shop_el: XMLElement) -> 'Shop':
    kwargs = {}
    for el in shop_el:
        if (el.tag == 'currencies'):
            currencies = []
            for currency_el in el:
                currencies.append(models.Currency.from_xml(currency_el))
            kwargs['currencies'] = currencies
        elif (el.tag == 'categories'):
            categories = []
            for category_el in el:
                categories.append(models.Category.from_xml(category_el))
            kwargs['categories'] = categories
        elif (el.tag == 'delivery-options'):
            delivery_options = []
            for option_el in el:
                delivery_options.append(models.Option.from_xml(option_el))
            kwargs['delivery_options'] = delivery_options
        elif (el.tag == 'pickup-options'):
            pickup_options = []
            for option_el in el:
                pickup_options.append(models.Option.from_xml(option_el))
            kwargs['pickup_options'] = pickup_options
        elif (el.tag == 'offers'):
            offers = []
            for offer_el in el:
                offer_type = offer_el.attrib.get('type')
                if (offer_type is None):
                    offer = models.SimplifiedOffer.from_xml(offer_el)
                elif (offer_type == 'vendor.model'):
                    offer = models.ArbitraryOffer.from_xml(offer_el)
                elif (offer_type == 'book'):
                    offer = models.BookOffer.from_xml(offer_el)
                elif (offer_type == 'audiobook'):
                    offer = models.AudioBookOffer.from_xml(offer_el)
                elif (offer_type == 'artist.title'):
                    offer = models.MusicVideoOffer.from_xml(offer_el)
                elif (offer_type == 'medicine'):
                    offer = models.MedicineOffer.from_xml(offer_el)
                elif (offer_type == 'event-ticket'):
                    offer = models.EventTicketOffer.from_xml(offer_el)
                elif (offer_type == 'alco'):
                    offer = models.AlcoholOffer.from_xml(offer_el)
                else:
                    raise exceptions.ParseError('Got unexpected offer type: {0}'.format(offer_type))
                offers.append(offer)
            kwargs['offers'] = offers
        elif (el.tag == 'gifts'):
            gifts = []
            for gift_el in el:
                gifts.append(models.Gift.from_xml(gift_el))
            if gifts:
                kwargs['gifts'] = gifts
        elif (el.tag == 'promos'):
            promos = []
            for promo_el in el:
                promos.append(models.Promo.from_xml(promo_el))
            if promos:
                kwargs['promos'] = promos
        else:
            kwargs[el.tag] = el.text
    return Shop(**kwargs)
@staticmethod
def from_xml(shop_el: XMLElement) -> 'Shop':
    kwargs = {}
    for el in shop_el:
        if (el.tag == 'currencies'):
            currencies = []
            for currency_el in el:
                currencies.append(models.Currency.from_xml(currency_el))
            kwargs['currencies'] = currencies
        elif (el.tag == 'categories'):
            categories = []
            for category_el in el:
                categories.append(models.Category.from_xml(category_el))
            kwargs['categories'] = categories
        elif (el.tag == 'delivery-options'):
            delivery_options = []
            for option_el in el:
                delivery_options.append(models.Option.from_xml(option_el))
            kwargs['delivery_options'] = delivery_options
        elif (el.tag == 'pickup-options'):
            pickup_options = []
            for option_el in el:
                pickup_options.append(models.Option.from_xml(option_el))
            kwargs['pickup_options'] = pickup_options
        elif (el.tag == 'offers'):
            offers = []
            for offer_el in el:
                offer_type = offer_el.attrib.get('type')
                if (offer_type is None):
                    offer = models.SimplifiedOffer.from_xml(offer_el)
                elif (offer_type == 'vendor.model'):
                    offer = models.ArbitraryOffer.from_xml(offer_el)
                elif (offer_type == 'book'):
                    offer = models.BookOffer.from_xml(offer_el)
                elif (offer_type == 'audiobook'):
                    offer = models.AudioBookOffer.from_xml(offer_el)
                elif (offer_type == 'artist.title'):
                    offer = models.MusicVideoOffer.from_xml(offer_el)
                elif (offer_type == 'medicine'):
                    offer = models.MedicineOffer.from_xml(offer_el)
                elif (offer_type == 'event-ticket'):
                    offer = models.EventTicketOffer.from_xml(offer_el)
                elif (offer_type == 'alco'):
                    offer = models.AlcoholOffer.from_xml(offer_el)
                else:
                    raise exceptions.ParseError('Got unexpected offer type: {0}'.format(offer_type))
                offers.append(offer)
            kwargs['offers'] = offers
        elif (el.tag == 'gifts'):
            gifts = []
            for gift_el in el:
                gifts.append(models.Gift.from_xml(gift_el))
            if gifts:
                kwargs['gifts'] = gifts
        elif (el.tag == 'promos'):
            promos = []
            for promo_el in el:
                promos.append(models.Promo.from_xml(promo_el))
            if promos:
                kwargs['promos'] = promos
        else:
            kwargs[el.tag] = el.text
    return Shop(**kwargs)