John Maxwell just sent a brilliant post to the XP mailing list. In this message, he's responding to someone asking whether XP works on fixed-price projects. The context is our professional responsibility to prevent code quality from degrading.
It depends on what you mean by "work". If you mean, will [XP] help you get the most value for the money spent, yes. If you mean, will it let you know as early as possible if you're not gonna meet all of the goals (if that's the case), again, yes.
If you mean, will it cause the impossible to suddenly become possible, no (well, unless it was only very slightly impossible :-). If you mean, will it enable you to delude yourself into thinking you can do too much work in too little time, again, no.
If you mean, will it give you a magic wand, to make the people who want more done than time and resources allow stop being unreasonable... maybe. It depends on whether they're prepared to face reality, and even more importantly, on _how_ they're prepared to face it.
But _your_ side of that is that you have to be honest enough to tell the truth, even when it's not what the person you're talking to wants to hear. Not whine about the truth, but accurately, calmly, and professionally report your progress, how much the customer can expect to get from you every time you sit down to plan an iteration, etc.
There are good reasons why the white book [Extreme Programming Explained, 1st ed.] talks about "courage". It's not a joke or "feel good" filler, and it's not easy.