Don Quixote Volume 1, Chapter 51
He tells a story of another rich man (farmer) and another gorgeous, virtuous maiden Leandra who were father and daughter. Eugenio (the goatherd telling the story) and Amselmo (not the character from the short story) are both seeking her hand in marriage and are both considered suitable. However, Leandra chooses instead to run off with a poor farmer's son, Vincent de la Rosa, who has returned home after serving many years as a soldier. (He is a charming braggart who through accessorizing makes his three uniform wardrobe look like twelve.) Vincent takes the jewels and money Leandra has stolen from her father, strips her down to her underclothes and closes her up in a cave.
She is found and claims she is still a virgin, so her father brings her to a convent; hoping time and her youth will heal her reputation. Amselmo and Eugenio leave town to live in a valley caring for the herds they own -- along with many other men, who also suffer from the distress of longing for the beautiful Leandra -- who can be heard blessing, cursing and singing about her as they care for their herds. Eugenio admits to relieving his stress by criticizing females in general and that's why he spoke in the manner he did to his goat; that despite her being the best animal in the herd, it's impossible for him to "think well of her" (pg. 346) since she is a female.