In One Thousand and One Nights, Ali Baba marries his faithful servant-girl after triumphing over the 40 thieves.