
995 So.2d 175 (2008)
S.A.N.
v.
S.E.N.
2061003.
Court of Civil Appeals of Alabama.
May 23, 2008.
*176 Debbie Lindsey Jared of Jared & Brunson, Elba, for appellant.
Sannon R. Clark, Enterprise, for appellee.
MOORE, Judge.

Procedural and Substantive Facts
On June 14, 2005, the trial court entered a judgment divorcing S.A.N. ("the mother") and S.E.N. ("the father"). The judgment awarded custody of the parties' two children to the mother, awarded the father certain visitation rights, including overnight visitation, and ordered the father to pay child support. On December 11, 2006, the father filed a petition seeking modification of the child-support provisions of the divorce judgment, as well as a judgment holding the mother in contempt for failing to abide by the visitation provisions of the divorce judgment. On April 5, 2007, after the mother had filed an answer to the father's petition, the trial court ordered the parties to mediation.
The parties settled the case at mediation on May 17, 2007, by agreeing that they would submit a stipulation of facts to the trial court for its ruling on the sole issue of whether Ala.Code 1975, § 15-20-26, prohibits the father from visiting with the children. The parties stipulated that, on April 17, 2006, the father had pleaded guilty to the criminal offense of first-degree sexual abuse. The victim of the sexual abuse was the mother's minor sister, who had resided with the parties during their marriage. The parties also stipulated that the father had not sexually abused or otherwise committed a crime against the parties' children.
The parties agreed that the father would not exercise visitation with the children until all appeals of the trial court's judgment had been exhausted. The parties also agreed that if the courts ultimately determined that the father's conviction precluded visitation, he would have no further visitation with the children. However, if visitation was allowed, the father would be allowed to visit with the children according to a specified schedule, which allowed visitation from 9:00 a.m. to 6:00 p.m. on Saturdays and Sundays, except Mother's Day, Father's Day, and every other Christmas Day, and otherwise as the parties mutually agreed.[1]
On July 5, 2007, the trial court entered a judgment awarding the father visitation *177 according to the schedule outlined in the mediation agreement. The trial court incorporated the stipulations of the parties and determined that the father would not violate Ala.Code 1975, § 15-20-26(c), by exercising his visitation rights because he would not be establishing a residence or any other living accommodation with the children. The mother filed a notice of appeal on August 3, 2007.

Issues
The issues for review are (1) whether the trial court erred in concluding that Ala.Code 1975, § 15-20-26(c), does not prohibit the father from having unsupervised visitation with the children in his home and (2), if not, whether the trial court erred in failing to consider the best interests of the children.

Analysis
Section 15-20-26(c) provides, in pertinent part:
"No adult criminal sex offender shall establish a residence or any other living accommodation where a minor resides. Notwithstanding the foregoing, an adult criminal sex offender may reside with a minor if the adult criminal sex offender is the parent, grandparent, or stepparent of the minor, unless one of the following conditions applies:
"....
"(3) The adult criminal sex offender has been convicted of any criminal sex offense in which a minor was the victim and the minor resided or lived with the offender at the time of the offense.
"(4) The adult criminal sex offender has ever been convicted of any criminal sex offense involving a child, regardless of whether the offender was related to or shared a residence with the child victim."
In this case, it is undisputed that the father was convicted of first-degree sexual abuse of a minor victim who resided with the father at the time of the offense, a sex-offense conviction indisputably triggering the operation of § 15-20-26(c)(3) and potentially triggering the operation of § 15-20-26(c)(4) depending on whether the father's sexual-abuse conviction was based upon the victim's having been a child under the age of 12 years (see Ala.Code 1975, §§ 13A-6-66(a) and 15-20-21(5) (defining first-degree sexual abuse and "child," respectively)), which the record does not disclose. Either provision would specifically preclude the father from establishing a residence or other living accommodation where one of his minor children resides. Thus, the question of law presented to this court is whether the visitation provisions approved by the trial court enable the father to establish a residence or other living accommodation where his children reside.
The mother argues that the court's holding in K.E.W. v. T.W.E., 990 So.2d 375 (Ala.Civ.App.2007), suggests that § 15-20-26 precludes a criminal sex offender from visiting with his or her children unsupervised at the criminal sex offender's residence. The mother notes that this court held in K.E.W. that the purpose of the statute is to protect children from the danger of recidivism posed by criminal sex offenders. 990 So.2d at 381. The court further held that a "living accommodation" in which a criminal sex offender spent all his waking nonworking hours in the house where the minor resided violated the statute because the living accommodation "allow[s] the criminal sex offender protracted time with the child in a private setting and expose[s] the child to the risk of recidivism the statute was designed to prevent." 990 So.2d at 382.
*178 Although we adhere to the principle that the purpose of the statute is to minimize the risk of recidivism by criminal sex offenders, we find that the legislature has unambiguously determined the manner in which it chose to reduce that risk. The legislature has directed that the criminal sex offender may not establish a residence or living accommodation "where a minor resides." The term "reside" is not a complex legal term; it is a word used in ordinary parlance meaning "to dwell permanently or continuously." Merriam-Webster's Collegiate Dictionary 1060 (11th ed.2003).
"[W]hen `the language of a statute is plain and unambiguous, ... courts must enforce the statute as written by giving the words of the statute their ordinary plain meaningthey must interpret that language to mean exactly what it says and thus give effect to the apparent intent of the Legislature.'"
University of South Alabama Hosps. v. Blackmon, 987 So.2d 1138 (Ala.Civ.App. 2007) (quoting Ex parte T.B., 698 So.2d 127, 130 (Ala.1997), and citing Perry v. City of Birmingham, 906 So.2d 174, 176 (Ala.2005); Ex parte Lamar Adver. Co., 849 So.2d 928, 930 (Ala.2002); Beavers v. Walker County, 645 So.2d 1365, 1376-77 (Ala.1994); Ex parte United Serv. Stations, Inc., 628 So.2d 501 (Ala.1993); and IMED Corp. v. Systems Eng'g Assocs. Corp., 602 So.2d 344 (Ala.1992)). The legislature evidently intended that criminal sex offenders cannot establish a residence or other living accommodation in a minor's permanent dwelling. The statute does not prohibit a criminal sex offender from having visitation with his or her child at the residence of the criminal sex offender where the child does not also reside. The plain words of the statute cannot be contorted to prohibit such visitation even if the overall purpose of the statute would be subserved thereby.
In this case, the trial court ordered that the father could visit with the children on weekends, certain holidays, and as the parties otherwise mutually agreed. By exercising those visitation rights, the father is not establishing a residence or other living accommodation where the children reside. The trial court therefore correctly determined that § 15-20-26(c) does not prohibit the father from visiting with the children as specified.
We note that many other states have adopted statutes directly addressing a criminal sex offender's right to visitation with his or her minor children. See, e.g., Ariz.Rev.Stat. § 25-403.05; Ark.Code Ann. § 9-13-101(d)(2) ("There is a rebuttable presumption that it is not in the best interest of the child ... to have unsupervised visitation with a sex offender."); Cal. Fam.Code § 3030(a)(1) ("No person shall be granted ... unsupervised visitation with[] a child if the person is required to be registered as a sex offender ..., unless the court finds that there is no significant risk to the child and states its reasons in writing or on the record."); 13 Del.Code Ann. Title 13, § 724A; 750 Ill. Comp. Stat. 5/607(e); Wash. Rev.Code § 26.10.160(2)(a)(iv) ("Visitation with the child shall be limited if it is found that the parent seeking visitation has ... been convicted as an adult of a sex offense...."). However, our legislature has elected not to enact a law specifically regulating the visitation rights of criminal sex offenders. Evidently, our legislature has concluded that Alabama's caselaw already provides an adequate remedy.
According to longstanding caselaw, any matter affecting a child may become the subject of chancery jurisdiction. Woodruff v. Conley, 50 Ala. 304 (1874). A circuit court exercising the traditional powers of a chancery court has "no more *179 important or sacred duty to perform than to look after the proper care and custody of minors coming within their jurisdiction." Murphree v. Hanson, 197 Ala. 246, 256, 72 So. 437, 441 (1916). Pursuant to that duty, in proceedings affecting visitation with a child, the paramount consideration for the court is always the best interests and well-being of the child. Allen v. Allen, 385 So.2d 1323, 1324 (Ala.Civ.App.1980). Therefore, a trial court may enter a judgment granting a party visitation privileges with a child only after conducting a hearing and determining that such visitation is in the best interests of the child. Shoemaker v. Shoemaker, 563 So.2d 1032, 1034 (Ala.Civ.App.1990) (citing Chandler v. Whatley, 238 Ala. 206, 189 So. 751 (1939)). Based on that standard, a trial court is authorized to restrict the visitation rights of a parent who poses a danger of sexually abusing a child based on the best-interests-of-the-child standard. See, e.g., T.G.S. v. D.L.S., 608 So.2d 743 (Ala.Civ.App. 1992); I.L. v. L.D.L., 604 So.2d 425 (Ala. Civ.App.1992); Miller v. Hawkins, 549 So.2d 102 (Ala.Civ.App.1989); and McAllister v. Price, 562 So.2d 517 (Ala.Civ.App. 1990). We have also recently held that a trial court may completely terminate a parent's visitation rights "based on evidence that would lead the trial court to be reasonably certain that the termination of visitation is essential to protect the child's best interests." M.R.D. v. T.D., 989 So.2d 1111, 1114 (Ala.Civ.App.2008). In choosing not to enact legislation on the subject, the legislature obviously relied heavily on the understanding that trial courts would perform their duties of vigilantly protecting the best interests of children residing in the state when fashioning visitation judgments.
In this case, however, the trial court failed in its duty to the children. The trial court evidently concluded that it was bound by the stipulation of the parties not only as to the facts but also as to the legal issue to be determined. Therefore, upon concluding that § 15-20-26(c) did not prohibit visitation, the trial court did not conduct any further inquiry as to the mode, duration, and extent of visitation privileges, if any, that would serve the best interests of the children. However, Alabama law has long held that an agreement of the parties affecting the welfare of a child is not binding on the court and will only be given effect to the extent that it is in the best interests of the child, because it is the child's interests that are primarily at stake. See Montgomery v. Hughes, 4 Ala. App. 245, 58 So. 113 (1911). Hence, an agreement of the parties regarding visitation with a child has no effect unless and until it is proven that the visitation to which the parties agreed is in the best interests of the child. See Shoemaker, supra (agreement granting stepfather visitation rights held unenforceable). Therefore, the parties' stipulation that the only issue to be decided was the applicability of § 15-20-26(c) did not affect the duty of the trial court to conduct a hearing and make a determination regarding the best interests of the children. We therefore reverse the judgment and remand the case to the trial court for it to conduct a hearing for the purpose of establishing a visitation plan that serves the best interests of the children.
AFFIRMED IN PART; REVERSED IN PART; AND REMANDED.
PITTMAN and THOMAS, JJ., concur.
THOMPSON, P.J., concurs in the result, without writing.
BRYAN, J., concurs in part and dissents in part, with writing.
*180 BRYAN, Judge, concurring in part and dissenting in part.
I concur in the main opinion insofar as it reverses the judgment of the trial court because the trial court failed to determine whether visitation with the father was in the best interest of the children. However, I dissent insofar as the main opinion holds that § 15-20-26(c), Ala.Code 1975, does not prohibit the father from having unsupervised visitation with the children.
The main opinion bases its holding that § 15-20-26(c) does not prohibit the father from having unsupervised visitation with the children on a literal construction of that statute. However, K.E.W. v. T.W.E., 990 So.2d 375 (Ala.Civ.App.2007), holds that the legislature intended § 15-20-26(c) to prevent a criminal sex offender from engaging in "activities generally allow[ing] the criminal sex offender protracted time with the child in a private setting[, i.e., unsupervised visitation,] and expos[ing] the child to the risk of recidivism [by a criminal sex offender] the statute was designed to prevent." 990 So.2d at 375. Allowing a criminal sex offender to have unsupervised visitation with a child at the sex offender's residence is just as inconsistent with the purpose of § 15-20-26(c), which is to protect children from "`the proven danger of recidivism by criminal sex offenders,'" K.E.W. v. T.W.E., 990 So.2d at 381, (quoting Salter v. State, 971 So.2d 31, 37 (Ala.Civ.App.2007)) as allowing a criminal sex offender to have unsupervised visitation with a child at the child's residence. Thus, the literal construction placed on § 15-20-26(c) by the main opinion dictates a result that is inconsistent with the purpose of that statute. See K.E.W. v. T.W.E.
As the Alabama Supreme Court has stated,
"`"[i]t has been called a golden rule of statutory interpretation that unreasonableness of the result produced by one among alternative possible interpretations of a statute is reason for rejecting that interpretation in favor of another which would produce a reasonable result.... It is fundamental... that departure from the literal construction of a statute is justified when such a construction would produce an absurd and unjust result and would clearly be inconsistent with the purposes and policies of the act in question. A construction resulting in absurd consequences as well as unreasonableness will be avoided."

"`Norman J. Singer, Sutherland Statutory Construction § 45.11, p. 61 (5th ed.1993).'"
Ex parte Watley, 708 So.2d 890, 893 (Ala. 1997) (quoting Ex parte Meeks, 682 So.2d 423, 428 (Ala.1996)) (emphasis added). Therefore, in the case now before us, because a literal construction of § 15-20-26(c) dictates a result that is inconsistent with the purpose of that statute, I would depart from that literal construction and hold that § 15-20-26(c) prohibits the father from having unsupervised visitation with the children. Accordingly, I respectfully dissent insofar as the main opinion holds, on the basis of a literal construction of § 15-20-26(c), that that statute does not prohibit the father from having unsupervised visitation with the children.
NOTES
[1]  The parties also agreed that child support would be recalculated according to the child-support guidelines and that any arrearage would be determined by the parties and submitted to the court. However, it appears that the trial court denied the petition to modify the father's child-support obligation after the parties failed to timely file the necessary documents. This appeal does not involve the child-support issue.
