Both things can be accomplished by the court.
Britney Spears' Courtroom Plea Spurs Questions for Her Lawyer