
75 Wis.2d 276 (1977)
249 N.W.2d 573
STATE EX REL. MEMMEL, and another, Respondents,
v.
MUNDY, Appellant.
No. 76-170.
Supreme Court of Wisconsin.
Argued November 16, 1976.
Decided January 18, 1977.
*280 For the appellant there were briefs by Robert P. Russell, corporation counsel for Milwaukee county, Gerard S. Paradowski, assistant corporation counsel, and Dean M. Horwitz, assistant corporation counsel, and oral argument by Mr. Horwitz, all of Milwaukee.
For the respondents there was a brief and oral argument by Thomas R. Cannon, Legal Aid Society of Milwaukee.
There was a brief and oral argument by Stanley F. Hack of Milwaukee, for Milwaukee County Board of Judges Amicus Curiae.
*281 Amici Curiae brief was filed by Edward P. Scott and Jane Bloom Yohalem, Mental Health Law Project, Washington, D. C., as counsel for amici curiae associations: American Orthopsychiatric Association; National Association of Criminal Defense Lawyers; National Association of Social Workers; Wisconsin Chapter, National Association of Social Workers; National Legal Aid and Defenders Association.
Amici Curiae brief was filed by Robert H. Blondis and Walther & Halling, all of Milwaukee, for: Corrections Legal Services Program; Milwaukee Bar Association; Milwaukee Junior Bar Association; Milwaukee Mental Health Association; National Association for Mental Health; State Bar of Wisconsin, Section on Individual Rights and Responsibilities Wisconsin Association for Mental Health; Wisconsin Black Lawyers Association; Wisconsin Civil Liberties Union Foundation, Inc.
Amicus Curiae brief was filed by Howard B. Eisenberg, state public defender, for State Public Defender.
Amicus Curiae brief was filed by Bronson C. La Follette, attorney general, and Robert D. Repasky, assistant attorney general.
[1] ROBERT W. HANSEN, J.
In point of time or place, the respondents' petition for declaratory relief is a caboose added to an already long freight train. However, we consider first that petition for declaratory relief for the reasons that (1) a declaration of rights is an appropriate vehicle for an exercise of the superintending control over inferior courts, constitutionally granted to this court,[1] and involved in the determinations here made; and (2) such petition deals with future procedures *282 to be followedthe major concerns of the parties here involved.
Additionally, the appeal here is only of the circuit court order appointing the Legal Aid Society of Milwaukee to represent indigents in involuntary mental health commitments "until a permanent plan to provide such representation can be presented to the trial court." The circuit court order finding constitutionally defective involuntary commitments earlier made and directing release or rehearing for all "persons presently committed to the Milwaukee county mental health center" has not been appealed. Since those thus committed and confined either have been released or given rehearings, issues concerning the order directing release or rehearing are moot, as discussed, infra. In any event, then, what happened in the past is not the primary focus here. Rather, the focus is on what future procedures are to be followed in involuntary commitment proceedings in Milwaukee county.
[2] The declaratory judgment petition seeks a delineation of the role and responsibilities of counsel appointed to represent persons involved in involuntary commitment proceedings under the State Mental Health Act.[2] At least as to indigents involved in such proceedings, it is a constitutional requirement that legal representation be provided for the person whose commitment is sought.[3] The controlling statute in this state goes beyond indigency *283 to require that ". . . the court shall appoint adversary counsel unless the subject individual chooses to retain his or her own attorney."[4]
This statute is specific and mandatory. It replaces a statute providing only that, at any stage of the commitment proceedings, the court ". . . may, if it determines that the best interest of the subject requires it, appoint a guardian ad litem for the patient."[5] We need not here deal with the difference in responsibility between an attorney appointed as "adversary counsel" and one appointed as a "guardian ad litem." (In actions affecting marriage, in situations where the appointment of a guardian ad litem to represent children is required,[6] our court has held that such appointed guardian ad litem "is the attorney for the children and their interests.")[7]
However, with the legislature now specifically requiring the appointment by the court of an "adversary counsel," it should be made clear that such appointed counsel has the same function, duties and responsibilities as he would have if he were retained by the person involved as his or her own attorney. The duties and responsibilities of lawyer to client in this state are set forth *284 in the Code of Professional Responsibility promulgated by this court.[8] They include preserving the confidences and secrets of a client,[9] exercising independent professional judgment on behalf of a client,[10] representing a client competently,[11] and representing a client zealously within the bounds of the law.[12]
These court rules and requirements apply to legal counsel for persons subject to involuntary commitment proceedings, whether retained by such persons or appointed by a court as "adversary counsel." We see no reason why the code provisions governing the attorney-client relationship should vary with the particular type of legal proceeding involved. Nonetheless, if need for such specialized treatment of a particular category of cases were to be suggested and established, a change in the Code of Professional Responsibility would best be made in the same manner in which the code was adoptedwith input from those interested and with consideration for the varying points of view.[13]
*285 Declaring the rights of persons subject to commitment does not stop at delineating the duties of counsel appointed to represent them under the adversary system of justice. Rather, as an exercise of the superintending control of this court, such declaration logically includes consideration of the manner in which counsel are appointed.
The statute provides appointment of counsel shall be by "the court."[14] The obvious reference is to the court conducting the commitment hearing.[15] However, in the case of hearings conducted in Milwaukee county, the legislature has also established a county board of judges and has provided that: "Such board may by majority vote of all members organize and establish, modify and repeal rules, not inconsistent with the statutes, to provide for the orderly, efficient and expeditious handling of all matters within the jurisdiction of such courts."[16]
On July 12, 1976, pursuant to such statutory grant of authority, the Milwaukee county board of judges adopted the following rule, establishing a procedure for the appointment of adversary counsel in mental health cases: "A panel of attorneys will be presented by the Milwaukee Bar Association and supplemented by the court. The *286 court will select attorneys from the panel serially to represent defendants. The list shall be updated periodically by the court and Association, but not less than once a year."[17]
[3] We hold this procedural rule to be not inconsistent with the statutes involved, but rather as a valid implementation of the rule-making authority delegated by the legislature to the Milwaukee county board of judges.[18] A requested report from the probate judges in Milwaukee county certifies that this is the procedure now being followed in appointing counsel for involuntary commitment proceedings under the Mental Health Act. We find complete statutory authority and no constitutional infirmity in the procedure established by the rule and now in operation in Milwaukee county.
Our court recognized the county board of judges' rule (Rule 640) and followed its provisions in granting a temporary stay of the trial court order. In that stay we directed the courts in Milwaukee county, pending this decision, to make appointments of adversary counsel to represent the interests of individuals involved ". . . seriatim on a case by case basis from the list of attorneys as approved by the Milwaukee County Board of Judges subject to the approval of the appointing judge as to any particular attorney."
That order of this court is to be read as implementing the procedural rule adopted by the county board of judges and as a recognition, then on a temporary basis, of the *287 board's right to make such rule. We now expressly hold such rule to be proper under the statute involved,[19] and to establish the procedure to be followed in making appointments of counsel in involuntary commitment cases in Milwaukee countythe only county to which the rule has application.
We do not now and did not then determine the question of public policy involved. Obviously there are several ways in which the appointment of counsel could be made, e.g., appointment of full-time public defenders, appointment of staff attorneys of a legal aid agency, appointment of private practitioners as the rule provides, or some combination of these. We deal here only with the right under the statute of the Milwaukee county board of judges to adopt the rule they adopted and to establish the procedure they have established. We here hold that they had the right so to do.
Coming now to the appeal of an order of the circuit court in the habeas corpus proceedings, we begin by noting that only one of two orders of the trial court has been appealed. The order not appealed is the order directing that all persons confined in the Milwaukee county health center on involuntary commitments be released, or given rehearings. (Order entered August 18, 1976, and modified September 7, 1976hereafter referred to as rehearing order.) Appellant elected to comply with this order for release-or-rehearing, rather than to challenge it by appeal.
Consequently, as we see it, no issue is now before us as to (1) the original commitment proceedings that led to the confinement of the class of persons involved at the county mental health center; (2) the right of the trial court here to order release-or-rehearing for the class of persons affected by its rehearing order; or (3) the special situation and unusual circumstances which led this court to deny writs of prohibition and permit to stand the trial *288 court order granting the motion of respondent Judith Pagels to intervene in the habeas corpus proceedings ". . . on behalf of a class of persons involuntarily committed to the Milwaukee County Mental Health Center for treatment." Thus, issues as to the status of these persons and the order directing their release-or-rehearing are not raised on appeal and not here before us for review.
[4] What is before us on this appeal, and all that is before us for review, is the ancillary order of the trial court, issued on the same day as modification of the rehearing order. In that ancillary order the trial court directed that the Legal Aid Society of Milwaukee, on a temporary basis, provide legal representation to indigent patients in involuntary commitment proceedings.[20] The trial court also retained jurisdiction to insure implementation of its rehearing order. The contention of appellant is that the trial court, in entering the ancillary order, went beyond its jurisdiction when it attempted to reach into the future. The merit of that challenge depends on how far the trial court reached and for what purpose.
Relief under habeas corpus is not limited to release of the person confined.[21] Habeas corpus is essentially an equitable doctrine,[22] and a court of equity has authority to tailor a remedy for the particular facts.[23] However, as the nation's highest court recently reminded us, ". . . [T]he extent of an equitable remedy is determined by *289 and may not properly exceed the effect of the constitutional violation."[24]
In the case before us, the trial court had found such constitutional violation as to the commitment of all persons confined in the county mental health center. The trial court ordered release-or-rehearing for all such confined persons. As of the August 18, 1976 order, the new statute requiring adversary counsel in all cases had not become effective. As of the September 7, 1976 amended order, it is far from clear that the panel and procedure mandated by Rule 640 of the county board of judges had been fully implemented. Given this situation, we would find no overreaching on the part of the trial court in insuring, as to the rehearings directed, ". . . that adequate constitutional safeguards are implemented for the protection of the patients at the Milwaukee County Mental Health Center."
The basic question here is as to the scope of the challenged ancillary orderits length in time and its breadth in coverage. If it could be read to mean that the trial judge who conducted the habeas corpus proceedings was to determine how all future appointments of counsel in commitment proceedings were to be made in Milwaukee county, it would conflict with the rule-making authority granted the county board of judges.[25] Likewise, if the retention of jurisdiction was read to be open-ended, in which case the judge conducting the habeas corpus proceedings would become a "monitor" over appointments of counsel in all future cases, it would also failconflicting with the statutes delegating the authority to appoint counsel[26] and to establish rules for making such appointments.[27]
*290 However, if viewed as providing legal representation and retention of jurisdiction solely to oversee implementation of the rehearing order, the ancillary order would appear not to go beyond insuring that the rehearing order was properly and constitutionally implemented. Thus, as an emergency based order, it can be reconciled with the statutes. As to the August 18, 1976 order, the provision for legal representation would not bar the appointment of guardians ad litem by the probate branches where the statute required.[28] As to the September 7, 1976 order, the stipulation of the parties (including the county board of judges by its chief judge),[29] made a conflict with the statutes[30] or a variance from the trial court order unlikely, if not impossible. Thus, construed as a temporary insurance of constitutionally adequate legal representation for the class of persons ordered released or reheard, the ancillary order appealed would appear to us not to have gone too far into the future nor to have collided with the statutes in its short journey.
However, even if such interpretation is given to the ancillary order of September 7, 1976, here appealed, we find that any issue as to the initial validity of the order has been mooted by subsequent events. At the time of oral argument, it was agreed that all persons confined in the mental health center by reason of earlier involuntary *291 commitments (the parties in the habeas corpus proceedings) had either been released or given rehearings. We hold this fact to render moot not only any issue as to the unappealed order directing release-or-rehearing, but also any issue as to the appealed order providing for temporary legal representation and retention of jurisdiction.
[5] In conclusion, we have held the following: (1) Declared the rights of all persons subject to involuntary commitment proceedings to representation by adversary counsel; and (2) declared, as an exercise of our constitutional superintending control over inferior courts,[31] sec. 257.37, Stats., to control this case and have thereby approved Rule 640 of the Milwaukee county board of judges as statutorily authorized and constitutionally viable; and (3) declared any issue as to the initial validity of the trial court's ancillary order which provides legal representation and retains jurisdiction over the case to be moot, since under any interpretation of the scope of such order, it has served its purpose and come to its end.[32]
In light of the above three-part holding, all issues properly before us on the petition for declaratory judgment and the appeal of the ancillary order of the trial court are resolved.
By the Court.Appeal dismissed. Rights declared.
NOTES
[1]  See: Art. VII, sec. 3, Wis. Const. See also: State ex rel. Reynolds v. County Court, 11 Wis.2d 560, 565, 105 N.W.2d 876, 879 (1960), this court holding: "In exercising this power of superintending control, this court is not restricted to the use of common-law writs and is limited only by the necessities of justice."
[2]  Ch. 51, Stats. 1973, entitled "State Mental Health Act," particularly secs. 51.01, 51.02, 51.03, 51.04 and 51.05, Stats., as amended in ch. 430, Stats. 1975, effective September 4, 1976.
[3]  Lessard v. Schmidt, 349 F. Supp 1078 (E. D. Wis. 1972); judgment reentered 379 F. Supp. 1376 (1974); judgment reentered 413 F. Supp. 1318 (1976). Accord, Quesnell v. State, 183 Wash.2d 224, 238, 517 P.2d 568, 577 (1974); Denton v. Commonwealth, 383 S.W.2d 681, 682 (Ky. Ct. of App. 1964); Suzuki v. Quisenberry, 411 F. Supp. 1113, 1129 (D. Hawaii 1976); and Lynch v. Baxley, 386 F. Supp. 378, 389 (M.D. Ala. 1974), holding that a guardian ad litem can satisfy right to counsel only if he is an attorney occupying a truly adversary position. See also: Zander, Civil Commitment in Wisconsin: The Impact of Lessard v. Schmidt, 1976 Wis. L. Rev. 503, 514-517.
[4]  Sec. 51.20(4), Stats., effective September 4, 1976.
[5]  Sec. 51.02 (4), Stats., repealed effective September 4, 1976.
[6]  Sec. 247.045, Stats., providing: "In any action for an annulment, divorce, legal separation, or otherwise affecting marriage, when the court has reason for special concern as to the future welfare of the minor children, the court shall appoint a guardian ad litem to represent such children. . . ."
[7]  de Montigny v. de Montigny, 70 Wis.2d 131, 141, 233 N.W.2d 463, 468, 469 (1975), this court holding: "The guardian ad litem is more than an adjunct to the court. He is the attorney for the children and their interests. He must perform his duties in accordance with the standards of professional responsibility adopted by this court. Code of Professional Responsibility, 43 Wis.2d, December 16, 1969. Nominal representation that fails to assure that children are treated as parties to the action is insufficient and constitutes a breach of the duties of professional responsibility."
[8]  Code of Professional Responsibility, 43 Wis.2d, adopted December 16, 1969, effective January 1, 1970.
[9]  Id. at xxxvi-xxxviii, Canon 4, A Lawyer Should Preserve the Confidences and Secrets of a Client.
[10]  Id. at xxxix-xlviii, Canon 5, A Lawyer Should Exercise Independent Professional Judgment on Behalf of a Client.
[11]  Id. at xlix-l, Canon 6, A Lawyer Should Represent a Client Competently.
[12]  Id. at li-lxvii, Canon 7, A Lawyer Should Represent a Client Zealously Within the Bounds of the Law.
[13]  For comments on role of counsel in involuntary commitment proceedings, see: Andalman and Chambers, Effective Counsel for Persons Facing Civil Commitment: A Survey, A Polemic, and a Proposal, 45 Miss. L.J. 43, 89-90 (1974); Litwack, The Role of Counsel in Civil Commitment Proceedings: Emerging Problems, 62 Cal. L.R. 816, 838-839 (1974); Special Project, The Administration of Psychiatric Justice: Theory and Practice in Arizona, 13 Ariz. L.R. 1, 51-60 (1971); Brunetti, The Right to Counsel, Waiver Thereof, and Effective Assistance of Counsel in Civil Commitment Proceedings, 29 Southwestern L.J. 684, 711-712 (1975); Flaschner, Legal Rights of the Mentally Handicapped: A Judge's Viewpoint, 60 A.B.A.J. 1371, 1374 (1974). See also: Developments in the Law Civil Commitment of the Mentally Ill, 87 Harv. L.R. 1190, 1288-1291 (1974); Note, The Role of Counsel in the Civil Commitment Process: A Theoretical Framework, 84 Yale L.J. 1540 (1975).
[14]  Sec. 51.20(4), Stats., effective September 4, 1976.
[15]  Sec. 51.20 (1)3.(c), Stats., effective September 4, 1976, provides:

". . . The petition may be filed in the branch of the county court which handles probate matters in the county where the subject individual is present or the county of the individual's legal residence. . . ." See also: Sec. 253.10, Stats., providing: "(11) In counties having a population of 500,000 or more, the probate jurisdiction, in addition to the foregoing, shall include matters under ch. . . . 51 . . . . The jurisdiction of matters under ch. 51 shall be concurrent with branches, 3, 4 and 12 and with the family court under s. 252.017(1)."
[16]  Sec. 257.37, Stats., applies only to counties having a population of 200,000 or more.
[17]  Rule 640, Milwaukee County Board of Judges.
[18]  Cf., State ex rel. Milwaukee County v. Wisconsin Council on Criminal Justice, 73 Wis.2d 237, 244, 243 N.W.2d 485, 489 (1976). In that decision this court stated: ". . . The resolution of the issue before this court does not rest upon the establishment of a policy, but rather the application of a statute. We make no expression of opinion as to whether the legislature should modify or change the procedure of appointment provided by sec. 970.02(6), Stats. . . .

". . . Only if the statute did not exist would such consideration be present. However, it does exist. . . ."
[19]  Sec. 257.37, Stats.
[20]  Trial court ancillary order issued September 7, 1976.
[21]  See: State ex rel. Matalik v. Schubert, 57 Wis.2d 315, 204 N.W.2d 13 (1973); State ex rel. Farrell v. Stovall, 59 Wis.2d 148, 207 N.W.2d 809 (1973); and State ex rel. Kovach v. Schubert, 64 Wis.2d 612, 219 N.W.2d 341 (1974), cert. denied, appeal dism'd., 419 U.S. 1117, 1130 (1975).
[22]  Anderson v. Anderson, 36 Wis.2d 455, 153 N.W.2d 627 (1967); State ex rel. Hannon v. Fisler, 270 Wis. 469, 71 N.W.2d 376 (1955). See also: Sanders v. United States, 373 U.S. 1 (1963), and Faye v. Noia, 372 U.S. 391, 438 (1963).
[23]  Town of Fond du Lac v. City of Fond du Lac, 22 Wis.2d 525, 531, 126 N.W.2d 206, 210 (1964).
[24]  See: Austin Independent School District v. United States, ___ U.S. ___ (1976). (No. 76-200, decided December 6, 1976.)
[25]  Sec. 257.37, Stats.
[26]  Sec. 51.20 (1)3.(c), Stats. 1975, and sec. 253.10(11), Stats. 1973.
[27]  Sec. 257.37, Stats.
[28]  Sec. 51.02(4), Stats., revised, effective September 4, 1976, ch. 430, Stats. 1975.
[29]  On September 2, 1976, the appellant, the respondents and the county board of judges, by its Chief Judge Michael Sullivan, acting for the executive committee of such board, stipulated that: "The Legal Aid Society of Milwaukee will be appointed to represent defendants in mental commitment proceedings pursuant to the inherent power of the courts and the rulemaking authority of the Milwaukee County Board of Judges [under sec. 257.37, Stats.] . . ." The stipulation provided that it was to remain in effect until and unless the trial court order of August 18, 1976 was stayed by this court or reviewed on appeal by this court.
[30]  Sec. 51.20 (1)3.(c), Stats., 1975, and secs. 253.10(11) and 257.37, Stats. 1973.
[31]  See: Art. VII, sec. 3, Wis. Const.
[32]  While not striking down the order as improvidently issued, we note the fact of its demise and the mootness of any issue as to its initial validity.
