By Huw Jones and Andreas Kröner

LONDON/FRANKFURT (Reuters) - Shareholders of the London Stock Exchange will vote on Monday on whether to back a $27 billion merger with Deutsche Boerse, even though the deal may have to be tweaked following Britain's decision to leave the European Union.

The two exchanges have insisted that their all-share merger to create the world's biggest bourse by revenue was essentially "Brexit proof", but the result of Britain's June 23 referendum has cast a shadow over the deal.

Germany's markets watchdog BaFin said last week that London could not host the headquarters of the planned European stock exchange giant if London is outside the bloc, saying it would be hard to imagine that the most important exchange in the euro zone would be steered from a headquarters outside the EU.

Shareholders of the 318-year old London exchange will vote at 0915 GMT on Monday on what is London's third attempt to merge with Deutsche Boerse in 16 years, the previous plans scuppered by a band of British stockbrokers, and a failed counterbid from Stockholm's bourse.

The results of the vote will be announced later on Monday.

Sources close to the deal have said they expect LSE shareholders to approve the merger.

Deutsche Boerse shareholders are being asked to approve the tender offer in a postal vote that will be completed by July 12.

Regulatory approval is seen as a major hurdle. While BaFin cannot veto the deal, its concerns are likely to be taken seriously by Deutsche Boerse - and by the German state of Hesse, where Deutsche Boerse is based. The state of Hesse has a veto power, along with the EU's competition unit.

The London Stock Exchange Group, which comprises the London exchange, Borsa Italiana in Milan and LCH.Clearnet, Europe's biggest off-exchange derivatives clearing house, had no comment.

When the Brexit vote result was announced on June 24, the London exchange said the deal would go ahead as planned without any changes to the terms.

Deutsche Boerse had no comment.

However, financial markets fell sharply on news of Brexit, sending sterling down to 30-year lows. That makes the 54:46 percent split between Deutsche Boerse and the London exchange far more favorable to the latter's shareholders as they would get the same number of Deutsche Boerse shares despite the pound's slump in value.

The two exchanges had already set up a committee to study the impact of Britain's referendum on the merger. It is headed by Deutsche Boerse Chairman Joachim Faber, who has said the choice of London as the sole headquarters of the holding company would have to be reviewed in the case of a Brexit.

It is unclear whether Britain would allow the combined group's head office to be in Frankfurt rather than London.

The committee is due to meet in coming weeks and could make non-binding recommendations.

It's not just the head office location that is likely to be discussed. The shape of Britain's future trading relations with the EU, which may take months or years to fully emerge, would also have commercial implications for the deal.

The British government has signaled that it won't formally inform the EU of the country's intention to leave the bloc until after the summer. Without this step, a two-year period to negotiate the divorce under the EU's Lisbon Treaty cannot begin.

Regulators are likely to want to see any recommendations before they make a ruling on the merger, and major changes to the deal could need further shareholder approval, people familiar with the process told Reuters.

(Reporting by Huw Jones; Editing by Susan Fenton)