Jim asked me to start a thread on the subject of tax avoidance to permit a debate and I am happy to oblige.
A judge once ruled that nobody should be under an obligation to so arrange his financial affairs (the defendant in the case was a man) so as to allow the Inland Revenue to take the maximum possible amount of money from him. I entirely agree with this.
Equally, when a person or company is trying to minimise their tax liability using ever more intricate devices, there comes a point where their accounts bears so little relationship to reality as to amount to a fraud on other taxpayers.
If a company is employing thousands of people in country A, earning billions of pounds in revenue in country A, shipping goods from warehouses in country A to customers in country A, and yet manages to declare the vast majority of the profits for this activity in country B for tax purposes, then something has gone badly wrong.
Of course, situations like this are almost always at least partly the responsibility of the tax authorities for allowing it - either because the tax code is ridiculously complicated or because they have been asleep at the wheel in not checking whether the returns they have been given are remotely plausible.
Evading tax by lying to the authorities is illegal: minimising your tax liability through legal means which making a full disclosure of the facts is always going to happen. It is the responsibility of HMRC to ensure we have a tax code in which the scope for legal avoidance of tax stops well short of the point where your accounts bear as much resemblance to the real world as Alice in Wonderland.