Angela Merkel has warned the EU it will have to change its conditions if it wants to keep the UK

REUTERS/Fabrizio Bensch LONDON (Reuters) - European Union leaders might have to consider changing the bloc's treaties in order to make the reforms Britain is seeking ahead of an in-out referendum, German Chancellor Angela Merkel was quoted as saying on Thursday.

Prime Minister David Cameron has promised to renegotiate the ties between London and Brussels before holding a vote on Britain's membership by the end of 2017. He has said he believes treaty change will be necessary to achieve those reforms.

"If that is really necessary then we have to think about it," the BBC quoted Merkel as saying in an interview when asked whether EU treaties would be changed to address British demands for reform of the bloc.

Merkel also said she could support some of the changes Cameron was asking for and in the past solutions have been found through the use of opt-outs.

"I'm optimistic that if we all want it, we'll find a good solution," she said. "It's not about losing sleep over this, but about doing our work and creating the necessary preconditions for Britain to remain in the EU."

On Monday, Norbert Roettgen, chairman of the foreign affairs committee in the German Bundestag and a lawmaker in Merkel's Christian Democrats, said it was not realistic to achieve treaty change within two years.

Merkel herself has backed the idea of treaty change in past years to bed down closer integration of euro zone countries, but German officials say in private that there is little appetite for this in other European capitals, making it unrealistic.

Earlier on Thursday, former German foreign minister Joschka Fischer said Cameron should not get carried away with apparent German support for his bid to reform the EU, saying Merkel had other priorities.