ANALYSIS: By Iain Macwhirter

This is actually a good outcome for us," a former Westminster Labour minister told me as Wendy Alexander delivered her resignation statement yesterday. Well, politicians are supposed to put a brave face on adversity, but seeing a silver lining in the resignation of Labour's second Scottish leader in less than a decade over expenses irregularities was a towering achievement of political optimism.

What I suspect he meant was that Labour could at least blame the SNP for Wendy's downfall. That it was the result of a politically motivated stitch-up by the nasty Nats and their stooges like, er, the Scottish Standards Commissioner, Jim Dyer - who might have his own views about the accusations of political bias.

When Labour complain about the rules on disclosure damaging politics and undermining parliamentary democracy they would do well to remember that it was their own government that introduced them. One has sympathy with Wendy Alexander over the apparent confusion and the contradictory legal advice she received - but why did she not just register the damn contributions to her leadership campaign in the first place? Why leave herself open to accusations of a cover up by sitting on them for two months?

Alexander talked of "vexatious complaints" from the Nationalists. Actually, as readers of this newspaper well know, the intelligence about Wendy Alexander's campaign contributions entered the public domain not via the SNP but through stories in the Sunday Herald. The formal complaints came later from members of the public with Nationalist connections.

Perhaps the bigger question is whether it was really necessary for Wendy to resign over an issue that resulted in a one-day suspension by the parliament's standards committee which might well have been rejected by the full parliament in September? Wendy Alexander and her Westminster bosses realised that her leadership simply wasn't working, that she was being overwhelmed by Salmond, and were looking for a suitable "out". There was a mutual interest in bringing this episode to an end, which is why many Labour politicians at Westminster are as relieved to see the back of her as she is to see the back of the job.

The collision with Gordon Brown last month over Alexander's call for a referendum on independence left serious damage on both sides. Westminster Labour MPs and ministers were incensed at Alexander's decision to adopt the Nationalist policy of giving Scottish voters the right to choose. Gordon Brown still refuses to accept that she actually called for a referendum. Alexander, for her part, has repeated her call on several occasions, most recently on the BBC's Question Time a fortnight ago.

When I spoke with her at length about her political beliefs shortly before her resignation, she told me that she had transformed Labour in Scotland. She claimed three achievements: the independence referendum, the Calman Commission on devolution and support for tax-raising powers. Alexander was confident that she had fundamentally changed Labour in Scotland, and that it didn't matter that the prime minister, or Westminster Labour MPs, didn't go along with her. In Holyrood she was the boss, and this was Wendy's law.

The question now is whether Wendy's law still rules. Will her successor endorse the independence referendum and a federal Holyrood with tax powers? When it comes to finding a successor to Alexander, will there be anyone with the courage and determination to continue in this neo-nationalist direction? I have my doubts.

THERE are real questions now about the future of Labour in Scotland. That its 50-year hegemony is over is beyond doubt. But what is left of the movement that used to dominate Scotland at every level of government? They have lost half their councillors and control only two of Scotland's councils. The party is in financial ruins, with donations drying up and trade unions turning away. The activist base has largely been destroyed by a decade of new Labour policies such as the Iraq war and renewal of Trident. Of course, a great political party like Labour cannot simply die - though I would expect more than a few defections to the SNP in the coming months if London Labour reasserts control. But where does it go now?

Wendy Alexander may have lacked many of the skills necessary for political leadership, but her analysis of the political situation in Scotland was sound. To meet the Nationalist challenge, Labour has to detach itself from Westminster and become more of a Scottish party. It can only do this by adopting an explicit federal agenda, calling for an autonomous Scottish parliament, with economic powers. Alexander would not call herself a federalist as such, but when I last spoke to her she was content to be described as taking Scotland in a broadly federal direction. She did not rule out control of broadcasting, for example, being devolved to the Scottish parliament.

Whoever takes over from Alexander will have to accept the logic of her political analysis; there really is no alternative. If she is replaced by a stooge, who rejects the independence referendum, neuters the Calman Commission and tries to play by the London rules, then Labour really is doomed in Scotland. This is their last chance to get it right before they hand the keys of Scotland to Alex Salmond permanently.