I'm no accountant, but i have the impression that there are various international agreements in place that basically says that earnings are to be taxed where they are made.
This is why there has been a bunch of hoopla over Irish tax incentives for example, as it allowed the likes of Microsoft, Apple and Google to claim all sales inside EU was done by their Irish office. The rest simple earned just enough to cover expenses...