Barter is the oldest and simplest form of economic activity, the business textbooks say, but that's not the lesson Washington real estate man Frank Kahn will be teaching in his next class at the Wharton School of Finance and Commerce in Philadelphia.

The way Kahn barters, the "oldest and simplest" becomes the newest and most complicated kind of business deal.

"A four-corner tax-free exchange" Kahn calls it.

In other words, a real estate swap.

But the deal Kahn closed yesterday was no ordinary backfence barter. It was a swap done with literally four dozen lawyers and accountants and a $2.4 million tax savings at stake.

As president of Washington Real Estate Investment Trust, Kahn swapped an $11.5 million Northwest Washington apartment building for two Montgomery County office buildings.

In all $23 million worth of property changed hands and because it was a swap rather than a straight sale, Washington REIT avoided paying capital gains taxes on its profits.

That's why swaps are becoming a more common method of doing real estate business, says Kahn, who's been teaching at the Wharton School for more than a decade.

The basic advantage of a trade, he explained, is that it allows investors to "take their profits" on a building which has appreciated in value without paying taxes on that appreciation.

The basic rule is that the investor has to "trade up" -- to swap for a more valuable property.

That means that a real estate speculator who buys a building for half a million and watches the building's value increase to $1 million, can trade his or her equity for a $2 million building without paying capital gains taxes.

Washington REIT made its first swap two years ago, trading a rent controlled apartment house at 3701 Connecticut Ave. NW. for an office building at 1901 Pennsylvania Ave. NW.

When a group of investors came to Washington REIT last year and offered to buy the apartment building at 4000 Tunlaw Road NW., Kahn suggested another swap.

The fact that they had no building to trade was no deterrent to the buyers, Cathedral Corp., owned by Meyer Feldman and Scott and Gary Nordheimer, three veteran real estate men. Cathedral is a specialist in condominium conversions.

Kahn, Feldman and the Nordheimer brothers then went shopping for something to trade for the 4000 Tunlaw Road building.

They found the tallest office building in the Washington area, the 23-story GBS Building in the Town Center of Rockville, which was for sale for $11.5 million.

The Tunlaw apartments were worth considerably more than that, so another property was thrown in the pot -- the $1.8 million State National Bank Building on Connecticut Ave., just north of the beltway in Kensington.

Both buildings fit nicely into the investment portfolio of Washington REIT, which has 95 percent of its funds invested in properties within an hour's drive of its office in Bethesda.

The trade, Kahn noted, would shift the balance of the company's investments away from more than half residential buildings to an even mix of apartments, offices and retail and commercial buildings.

It all looked good on paper. How much paper, Kahn didn't know until he and the platoons of lawyers started planning for the actual closings.

To pull the deal off, the owners of the two Montgomery County buildings had to sell them to Cathederal, which simultaneously traded the two buildings for 4000 Tunlaw Road.

A room that would seat 50 persons was arranged for the closing, which took three sessions to complete.

In early August the lawyers set down with a checklist -- "actually we had checklists of checklists," said Kahn -- and in a day-long session assured that all the necessary papers were in order.

Then the accountants met, to be sure all the numbers added up and to go through the closing process. Yesterady they signed the deal and filed by an 18-inch stack of documents recording the deal.

Some cash did change hands -- about $110,000 was paid by Washington Real Estate Investment Trust to balance out the total value of the office buildings against the value of the apartments.