
984 So.2d 472 (2007)
Barbara WATKINS
v.
Gary A. HARPER and Laurie D. Harper.
2060723.
Court of Civil Appeals of Alabama.
November 16, 2007.
*473 Philip D. Segrest, Jr., and Dale Segrest of The Segrest Law Firm, Tallassee, for appellant.
S. Chad Lee and Erin K.Q. Corbally, Wedowee, for appellees.
PITTMAN, Judge.
Barbara Watkins appealed from a judgment of the Chambers Circuit Court dismissing her complaint seeking a judgment quieting title to certain real property. That appeal was transferred to this court by the Alabama Supreme Court pursuant to § 12-2-7(6), Ala.Code 1975.
Gary A. Harper and Laurie D. Harper ("the Harpers") were neighbors of Shawn Watkins ("the son") and Barbara Watkins ("the mother"); however, a dispute arose over the ownership of a tract of real property on which the son was residing ("the disputed property"). The Harpers filed a complaint in the Chambers Circuit Court seeking to quiet title to the disputed property. The son was properly served; service by publication was also undertaken as to other parties who might have had a claim to the disputed property, see Rule 4.3, Ala. R. Civ. P. The Harpers' attorney, however, did not personally serve the mother because the Harpers apparently did not know that the mother claimed ownership of the disputed property. After a hearing on the matter, the trial court entered a judgment in favor of the Harpers declaring that they owned the disputed property. It was undisputed that the mother was aware of that action and was present at the hearing.
Afterwards, on October 23, 2006, the mother filed a complaint in the trial court seeking to quiet title to the disputed property and alleging that that court's previous judgment in favor of the Harpers should not apply to her because, she claimed, she was not personally named as a party in the Harpers' complaint. The mother stated that "[she] is the Harpers' neighbor, and although the Harpers knew of [her] . . . claim, they did not make her a party to that action."
The Harpers filed a motion to dismiss the mother's complaint under Rule 12(b)(6), Ala. R. Civ. P., and asserted a claim under the Alabama Litigation Accountability Act ("ALAA"), § 12-19-270 et seq., Ala.Code 1975. The mother filed responses to the Harpers' motion to dismiss and their claim under the ALAA. After a hearing on the matter, the trial court granted the Harpers' Rule 12(b)(6) motion, *474 dismissing the action with costs taxed as paid; it did not expressly rule upon or retain jurisdiction over the ALAA claim, thereby denying it. See Donnell Trucking Co. v. Shows, 659 So.2d 667, 669 (Ala.Civ. App.1995)
The mother essentially contends that the trial court erred in dismissing the action because, she says, the Harpers knew that she had an ownership claim in the disputed property; she was not properly served in, and did not receive proper notice of, the Harpers' action; and, therefore, her claim was not barred by the doctrine of res judicata.
The standard of review applicable to an order granting a motion to dismiss is well established:
"`"The appropriate standard of review under Rule 12(b)(6)[, Ala. R. Civ. P.,] is whether, when the allegations of the complaint are viewed most strongly in the pleader's favor, it appears that the pleader could prove any set of circumstances that would entitle her to relief. Raley v. Citibanc of Alabama/Andalusia, 474 So.2d 640, 641 (Ala.1985); Hill v. Falletta, 589 So.2d 746 (Ala.Civ. App.1991). In making this determination, this Court does not consider whether the plaintiff will ultimately prevail, but only whether she may possibly prevail. Fontenot v. Bramlett, 470 So.2d 669, 671 (Ala. 1985); Rice v. United Ins. Co. of America, 465 So.2d 1100, 1101 (Ala. 1984). We note that a Rule 12(b)(6) dismissal is proper only when it appears beyond doubt that the plaintiff can prove no set of facts in support of the claim that would entitle the plaintiff to relief."'
"Beckerle v. Moore, 909 So.2d 185, 187 (Ala.2005) (alterations added in Beckerle) (quoting Nance v. Matthews, 622 So.2d 297, 299 (Ala.1993)).
"Furthermore, when `[t]he trial court dismiss[es] . . . claims, based on the doctrine of res judicata[,] the application of that doctrine is a question of law.' Walker v. Blackwell, 800 So.2d 582, 587 (Ala.2001). `"This Court reviews questions of law de novo."' Alabama State Bar v. Quinn, 926 So.2d 1018, 1023 (Ala. 2005) (quoting Tipler v. Alabama State Bar, 866 So.2d 1126, 1137 (Ala.2003))."
EB Invs., L.L.C. v. Atlantis Dev., Inc., 930 So.2d 502, 507-08 (Ala.2005).
For the doctrine of res judicata to apply, four essential elements must be shown:
"`(1) a prior judgment on the merits, (2) rendered by a court of competent jurisdiction, (3) with substantial identity of the parties, and (4) with the same cause of action presented in both actions. If those four elements are present, then any claim that was, or that could have been, adjudicated in the prior action is barred from further litigation.'
"Equity Resources Mgmt., Inc. v. Vinson, 723 So.2d 634, 636 (Ala.1998). Our supreme court has explained the doctrine of res judicata as follows:
"`[R]es judicata . . . involves prior litigation between a plaintiff and a defendant, which is decided on the merits by a court of competent jurisdiction, and then a subsequent attempt by the prior plaintiff to relitigate the same cause of action against the same defendant, or perhaps to relitigate a different claim not previously litigated but which arises out of the same evidence. Alabama law is well settled that this will not be allowed. A valid, final judgment on the merits of the claim extinguishes the claim. If the plaintiff won, the claim is merged into the judgment; if the defendant won, *475 the plaintiff is barred from relitigating any matter which could have been litigated in the prior action.'
"Id. at 636-37, quoting Whisman v. Alabama Power Co., 512 So.2d 78, 81 (Ala. 1987). `To determine whether the same cause of action is involved in both actions, the court must decide whether the issues in the two actions are the same and whether the same evidence would support a recovery for the plaintiffs in both actions.' Benetton S.p.A. v. Benedot, Inc., 642 So.2d 394, 399 (Ala.1994); Vinson, supra."
McClendon v. Hollis, 784 So.2d 1041, 1044 (Ala.Civ.App.2000).
Under Alabama law, a party bringing an action to quiet title is required to personally name in the complaint all parties who are known to have a claim to the lands made the subject of that action. Ala.Code 1975, § 6-6-561, provides:
"A complaint under this division must be brought against the land or the interest therein sought to be established. . . . It shall also make party or parties defendant to said complaint all persons against whom the plaintiff claims title to said lands, or the interest therein sought to be established, and if the names of such persons cannot be ascertained by the plaintiff with certainty, they may be designated and joined as unknown parties. Such complaint shall also make party or parties defendant thereto all persons who are known to the plaintiff to have had possession of said lands, or any part thereof, within 10 years next preceding the filing of the complaint, or who are known to the plaintiff to claim said lands, any part thereof or any interest therein, whether such interest be present, future, contingent, reversionary, or otherwise."
(Emphasis added.)
In Ex parte Jim Walter Homes, Inc., 712 So.2d 733 (Ala.1998), the Alabama Supreme Court stated that "[a]n action purporting to adjudicate title to real property is not binding on a person claiming title to, or an interest in, the property, if that person's identity is ascertainable through the exercise of reasonable diligence and yet that person is not made a party to the action." 712 So.2d at 737. See also Dominey v. Mathison, 292 Ala. 293, 293 So.2d 472 (1974) (holding that the trial court in a quiet title action incorrectly applied the doctrine of res judicata to preclude the claims of parties who had received constructive notice in a prior quiet-title action and that the statutes governing quiet-title actions impose a duty of diligent inquiry, i.e., a duty to exercise reasonable diligence, in finding the names and addresses of parties having potential claims to an interest in lands).
In this case, viewing the facts in the complaint most strongly in the mother's favor, it appears that the mother could possibly prevail on her claim and that, therefore, dismissal of her claim was erroneous. See Raley v. Citibanc of Alabama/Andalusia, 474 So.2d 640, 641 (Ala. 1985); Hill v. Falletta, 589 So.2d 746 (Ala. Civ.App.1991); and Fontenot v. Bramlett, 470 So.2d 669, 671 (Ala.1985). As stated above, the doctrine of res judicata requires "`(1) a prior judgment on the merits, (2) rendered by a court of competent jurisdiction, (3) with substantial identity of the parties, and (4) with the same cause of action presented in both actions.'" McClendon, 784 So.2d at 1044. Granted, if those elements are met, then any claim that was, or that could have been, adjudicated in the previous action will be barred; however, in an action to quiet title, reasonable diligence is required in ascertaining the identity of those persons who may have a claim to the property. The mother *476 specifically stated in her complaint that the Harpers knew that she had a claim to the property involved in the previous quiet-title action and that she had not been properly served. Moreover, the son, the mother, and the Harpers were all neighbors; it can be inferred that, through reasonable diligence, the Harpers could have discovered that the mother had a claim to the disputed property. Thus, the substantial-identity element of the doctrine of res judicata was not met, and the trial court, therefore, erred in dismissing the mother's complaint. Because we conclude that the trial court erred as to this issue, we need not address the remaining issues raised by the mother.
The judgment of the trial court is reversed, and the case is remanded for further proceedings consistent with this opinion.
REVERSED AND REMANDED.
THOMPSON, P.J., and THOMAS and MOORE, JJ., concur.
BRYAN, J., concurs in the result, without writing.
