OTTAWA -- Just days after the Speaker of the Senate pledged allegiance to transparency and accountability, the upper chamber's lawyers appeared in court Thursday to block the release of a potentially embarrassing internal document.

Pushing back are lawyers for suspended Sen. Mike Duffy and a group of Canadian media outlets. Duffy's trial paused briefly Thursday so the judge could hear arguments over whether the document should be released.

The suspended senator for Prince Edward Island has pleaded not guilty to 31 charges of fraud, breach of trust and bribery. Several charges relate to his declaration of a home in Ottawa as a secondary residence, enabling him to claim nearly $90,000 in housing expenses.

The contentious document is a never-before-seen internal audit conducted in early 2013 by senior Senate official Jill Ann Joseph after questions began to emerge about Duffy and other senators claiming living expenses for homes in Ottawa.

Joseph, who had been reviewing the residency status of senators, found a lack of criteria for establishing residency -- a conclusion that dovetails with the arguments Duffy's lawyer Donald Bayne has been making.

The Senate -- under the authority of Speaker Leo Housakos -- says the secret audit should not be released because of parliamentary privilege. That centuries-old protection accords legislators immunity from the courts, so that they can fulfil their parliamentary duties with the maximum amount of freedom.

"No questioning of what is said within the walls of Parliament is permissible within the principle of parliamentary privilege," said Maxime Faille, the lawyer hired to represent the Senate.

The Senate is just picking and choosing which documents it wants to release, one of Duffy's lawyers, Peter Doody, argued before Ontario Justice Charles Vaillancourt.

The upper chamber never batted an eye when the court demanded a wide range of internal Senate documents relating to Duffy, Doody noted, including records that had previously been considered secret. All have been entered into evidence.

Nor did the Senate's lawyer speak up when two Senate officials talked about the internal audit during an RCMP interview, he said.

"The Senate has lifted the curtain on what it wants the court and defence to see, while keeping other parts of the curtain closed covering information dealing with the exact same issue, which they don't want the defence and the court to see," Doody said.

Faille countered that the Senate has the absolute prerogative to waive privilege on certain documents, but not others.

Neither Housakos nor government Senate leader Claude Carignan would comment Thursday.

Liberal Sen. George Baker, a former clerk of the Newfoundland legislature, said the Senate's decision to hand over documents in Duffy's case could wind up having an impact on privilege.

"I think it's been upset by the production orders that arrived here in the Senate as it pertains to matters presently before the court and I would think that in making a judgment on parliamentary privilege, it's not as clear-cut as it was 10 years ago," Baker said.

Doody also argued that the internal audit shouldn't even fall within the ambit of parliamentary privilege -- it isn't testimony at a committee or chamber hearing.

Faille countered that nothing could be considered more internal to the workings of the Senate than a clerk producing a document for a committee.

Both Doody and media lawyer Peter Jacobsen said the Senate has to prove why it's absolutely necessary to protect the document, part of a test set out in a 2005 Supreme Court case.

Jacobsen, acting as an intervener on behalf of CTV, the Globe and Mail, Postmedia and Canadian Journalists for Free Expression, said the court should introduce a new wrinkle in that test of necessity -- the public interest and the accountability of public institutions.

Parliamentary privilege is about giving legislators freedom and not about keeping things secret, he noted.

"The public today expects more accountability and transparency from its public institutions."

--With files from Jordan Press