* ANZ's cash profit jumps about 23% to record A$3.82 billion

* Interim profit slightly better than analyst forecast

* Institutional banking generates more profit than mortgages

May 5 (Reuters) - Australian lender ANZ Banking Group Ltd said it was diversifying beyond a residential mortgage market gripped by competition on Friday as earnings from its institutional arm overtook home lending.

The country's No. 4 lender reported a record first-half result as banks shift away from their traditional earnings engine of home lending, with borrowers hunting for cheaper deals, spurred by surging inflation and interest rates.

"It's been incredibly competitive in Australian home loans. It's certainly not as attractive as it used to be," Chief Executive Shayne Elliott said on a call with reporters.

"Margins have been declining for 30 years, there's been a few blips along the way, but we think the downward trend is going to resume," he added, referring to mortgages.

Banks say competition is eroding the margin benefits they typically enjoy when rates rise.

In the six months to March, ANZ said operating profit jumped nearly 23% to A$3.82 billion ($2.56 billion), just ahead of the average analyst forecast of A$3.81 billion, as its net interest margin, a closely watched metric of interest takings less costs, widened.

But operating profit at its Australian retail banking unit rose just 1% from the same period a year earlier, to A$1.1 billion, as the Melbourne-based lender and most rivals offer cash handouts to lure new borrowers.

Institutional banking, which sells some non-interest services, such as unbranded "white box" cross-border payments for other financial services firms, grew operating profit 69% to A$1.6 billion.

ANZ processes more than half of all payments from abroad into Australia and New Zealand, it said.

In comments published by the bank with the earnings announcement, Elliott said the bank had to ask itself whether it should "double down on housing or small businesses or in institutional?"

He added, "Those decisions are becoming a lot more complex."

ANZ shares rose nearly 2% by dissension in a flat market, as analysts cheered a small earnings beat and a strategy of looking outside the hard-fought housing sector.

A day earlier, larger National Australia Bank Ltd saw its shares dive after missing forecasts amid a wider concern about bank profits.

"This is a better result than many investors feared after yesterday," Citi analyst Brendan Sproules said in a client note.

The result shows "ANZ is benefiting from business diversification," said Barrenjoey analyst Jonathan Mott.

Elliott pointed to a small uptick in borrower stress, but said most homeowners kept up timely mortgage payments while business customers reported persistent strong demand.

"The Australian economy remains resilient," Elliott said, as feedback from the bank's business customers suggested they "feel robust, even if a little wary of the future."

ANZ declared an interim dividend of 81 Australian cents, up from 72 cents a year earlier.

Westpac Banking Corp and Commonwealth Bank of Australia are set to report results next week. ($1=A$1.4945) (Reporting by Byron Kaye in Sydney and Navya Mittal and Savyata Mishra in Bengaluru; Editing by Sherry Jacob-Phillips and Clarence Fernandez)