Sadly, the more these attacks occur, the more nationalism will gain favour. Most Western people are against their Government's military intervention in the Middle East (so much for democracy!) however these attacks breed hatred and warmongers. Once the nationalists gain enough support, it will become apparent that it is wrong to think that radical islamists have a monopoly on barbarity.
The solution to this problem can not start from the basis of "us and them". We need to acknowledge that western military intervention has only made the problem worse. More of the same is insane. First completely withdraw all military forces in the Middle East, and focus defence spending on border control. Next cut all foreign aid, cut welfare for immigrants, and cut all economic sanctions on foreign nations. We need to strengthen freedom of speech so that we can properly criticise the backwardness of wahhabism such as its brutal treatment of women, gays and those that speak against it. Only through a dedication to the principles of freedom and liberty can western countries gain the respect of moderate Islam, which is paramount to sending radical Islam into irrelevance.