Apple [NASDAQ: AAPL] CEO Tim Cook, in Washington, D.C., today to answer questions about his company's avoidance of billions of dollars in U.S. taxes, told a Senate hearing the tech giant followed the law and "comprehensive tax reform" must be passed to even the playing field for multi-national companies.

In his testimony, Cook called for a simplification of the U.S. corporate tax code that will allow the "free flow of capital back to the United States."

"We not only comply with the laws, but we comply with the spirit of the laws," said Cook, whose company has more than $140 billion in cash parked overseas.

Cook was accompanied by Apple's chief financial officer and senior vice president Peter Oppenheimer and the company's head of tax operations, Phillip Bullock.

The testimonies of Cook and Oppenheimer followed the first panel, which included testimony from J. Richard Harvey and Stephen Shay, law professors at Villanova University School of Law and Harvard Law School, respectively.

During the first panel, Sen. Carl Levin, D-Mich., and Sen. Rand Paul, R-Tenn., exchanged stern words regarding the hearing hosted by the permanent subcommittee on investigations, which Levin chairs.

"Frankly, I'm offended by the tone and tenor of this hearing," Sen. Paul said, adding he was offended by the government "bullying and berating" one of America's "greatest success stories."

After Paul said the committee should apologize to Apple, Levin said Paul was welcome to apologize to Apple himself.

Levin questioned the nature of Apple's holding companies abroad, which own Apple subsidiaries.

Bullock said interest earned abroad is subject to U.S. taxes, while Levin pointed out particular foreign holding companies under Apple do not file corporate taxes with the United States.

Sen. John McCain, R-Ariz., asked whether Cook was "dragged" to the committee, which Cook denied with a laugh.

"I think it's important that we tell our story," Cook said.

McCain asked whether Apple has an unfair advantage over domestic-based, smaller companies that are not able to have holding companies abroad.

"No, sir, that's not the way that I see it," Cook said, explaining Apple's profits earned outside the U.S. are not taxable in the U.S., which is why Apple set up holding companies abroad beginning in 1980 before the iPad, iPhone, or even the first Mac computer.

"The way that I look at this, there is no shifting going on," Cook said.

On Monday, Apple released an advance copy of Cook's testimony. Its 17 pages of self-defense are clear, blunt, and unambiguous: Apple, Cook declares, "does not use tax gimmicks." It pays "an extraordinary amount" in U.S. taxes -- nearly $6 billion last year, making it "likely the largest corporate income tax payer in the U.S." Its effective tax rate last year, he says, was approximately 30.5 percent.

Cook implies that Congress, intent on removing a speck (figuratively speaking) from Apple's eye, may perhaps have overlooked the 2-by-4 in its own: an outdated tax code.

"Apple," he says, "welcomes an objective examination of the U.S. corporate tax system, which has not kept pace with the advent of the digital age and the rapidly changing global economy."

He went on to recommend reforms.

Referring to the way Apple manages to lessen its U.S. tax bill by moving money around overseas, he concludes: "While some Subcommittee members may have differing views on these tax policy matters, Apple hopes the Subcommittee will see that these recommendations aim to create meaningful change and go well beyond what most U.S. companies propose."

(Robert A. Iger, chief executive officer of The Walt Disney Co., parent company of ABC News, is a member of Apple's board of directors.)

On Monday night, the subcommittee took a swing at Apple by releasing a 40-page memorandum, which, after a 16-page highlights-reel, gets down to business, asserting that Apple has used a variety of "offshore structures, arrangements, and transactions to shift billions of dollars in profits away from the United States and into Ireland, where Apple has negotiated a special corporate tax rate of less than 2 percent."

"One of Apple's more unusual tactics," says the Subcommittee, has been "to establish and direct substantial funds to offshore entities that are not declared tax residents of any jurisdiction."

These entities are, in effect, corporate men-of-the-world.

One such entity, Apple Operations International, which was established in 1980, says the memo, is currently sauntering about with $30 billion in its pocket. Yet, during the four years during which it earned that sum, it "paid no corporate income taxes to any national government."

While the subcommittee stops short of accusing Apple of having broken any U.S. law, it finds the company to have circumvented the U.S. Tax Code's Subpart F, whose purpose is "to prevent multinational corporations from shifting profits to tax havens to avoid U.S. tax."

So adroitly has Apple peeled Subpart F, says the memo, that from 2009 to 2012, it managed to avoid "$44 billion in taxes on otherwise taxable offshore income."

On Monday, ABC News quoted Sen. John McCain as saying: "Apple claims to be the largest U.S. corporate taxpayer, but by sheer size and scale, it is also among America's largest tax avoiders."

Subcommittee chairman Sen. Carl Levin, speaking Monday with reporters, said that while Apple might be a golden goose, it had played fast and loose with some of its eggs.