It isn't exactly easy, but it isn't hard. Briefly, here's how an XP team goes about it.
First, we have to have the user stories on cards. It would be nice to have all of them. It's important to have enough of them, and to write placeholder cards for stories that don't exist yet.
The entire team, customers and programmers, goes through all the stories. Customers explain what the system has to do, and the team brainstorms quickly how it might be done. Estimate each card in programmer weeks: one, two, or three weeks of one programmer's time.
If a story seems much less than a week, batch it with a few other small ones. If it seems more than three weeks, take that as a sign that you don't understand it. Get the customers ...