DAVID Cameron has received a boost from Europe's powerhouse after Germany's Angela Merkel said that treaty change, seen as essential to the Prime Minister's plan for reform, was "not totally impossible".

But Mr Cameron's grand tour of Europe suffered a less helpful contribution in Poland, where the country's Europe Minister, Rafal Trzaskowski, warned "discriminatory measures" on welfare were a red line for Warsaw. One of the PM's key aims is to get reform on in-work benefits for foreign workers.

Following talks in Berlin, Mrs Merkel said it was Germany's "clear-cut hope" that Britain stayed in the EU but admitted negotiations on Mr Cameron's reform agenda were set to be "protracted", suggesting that any hope of a quick referendum in 2016 might be dashed.

"Of course, we have the desire to work very closely together," the German leader told a news conference. "We would like to be a part of the process that is going on in Great Britain at the moment and we would like to be a constructive partner in this process.

"I have also said wherever there is a desire, there's also a way and this should be our guiding principle here as well."

It was this last phrase which raised Mr Cameron's hopes that a way forward on his reform agenda could be found given Germany's central importance to the EU.

He said: "Of course, there is no magic quick solution but, as the Chancellor has said on this previously, and again today, where there's a will there is a way.

"The European Union has shown before that when one of its member states has a problem that needs sorting out, it can be flexible enough to do so, and I have every confidence that it will do so again."

The PM maintained that the EU was better off with the UK as a member and that Britain's national interest could best be served by staying in the Brussels bloc - on the basis of a reformed settlement.

"That is what we both want to happen and that is what we will work together in the coming months to achieve," he added.

Mr Cameron believes treaty change is essential to deliver real reform in key areas such as welfare yet France and Germany have previously been cool on the idea.

The German Chancellor said she was sure they would find common ground with Britain over the reforms of the Single Market "very quickly" and left open the possibility of treaty change.

"Is it necessary to change the treaty? Can it be changed via a secondary process? If you are convinced of the content or the substance, then we shouldn't be saying 'to change the treaty is totally impossible'."

The PM had less to get heartened about when he met his Polish counterpart in Warsaw, failing to secure support for his core plan to restrict benefits for migrant workers.

No 10 claimed Mr Cameron and Ewa Kopacz had found "much they could agree on" during their talks but accepted plans for benefit reforms "should be discussed further".

Poland has repeatedly condemned proposals to curb welfare for migrant workers as "discriminatory" and pledged to block them.

Mr Trzaskowski said: "David Cameron says he does not question the free movement of workers per se but he wants to discuss the questions of social policy and of social benefits.

"Our message was clear; it is of utmost importance for all of us to keep the United Kingdom within the European Union and we are ready to sit down with the British and discuss the issues.

"But, obviously, our red line is non-discrimination. We have to take such decisions that are not going to discriminate against anyone within the Union. These are going to be tough discussions but we are open to talks with our British counterparts."

A Downing Street spokesman said: "On immigration and welfare, Prime Minister Kopacz welcomed the PM's commitment to respect the principle of free movement. They agreed that there were issues concerning the interaction between free movement and national welfare systems that should be discussed further."

Mr Cameron is due to speak to all 27 EU leaders before the next European Council summit next month.