
31 So.3d 126 (2009)
Wayne GATLIN
v.
Marvin JOINER et al.
2080611.
Court of Civil Appeals of Alabama.
September 4, 2009.
*128 M. Scott Harwell, Birmingham, for appellant.
Debra H. Coble and Frank V. Potts of Potts & Young Attorneys, L.L.P., Florence, for appellees.
BRYAN, Judge.
Wayne Gatlin, the plaintiff below, appeals from an interlocutory order insofar as it partially granted the summary-judgment motion of the defendants below, Marvin Joiner, Rose Neal, and Jerry Frank Neal, and from a final judgment insofar as it partially denied Gatlin's claim seeking a permanent injunction. We reverse and remand.

Factual Background and Procedural History
The dispute in this case concerns a gore of land ("the gore") containing approximately one-half acre. The gore is located in the northeast quarter of Section 31 in Lauderdale County ("Section 31"), is bounded on the north, south, and west by Bluewater Creek, and is bounded on the east by the section line ("the section line") separating Section 31 from Section 32 in Lauderdale County ("Section 32").
In 1973, Maybelle Sledge Herston executed a deed purporting to convey to Virginia Herston Stacey Gant the gore and a portion of the northwest quarter of Section 32, which lies immediately east of the gore. In 1993, Gant subdivided her land into lots, which she sold to, among others, Joiner and the Neals.
In May 1995, Gatlin's parents signed a deed purporting to convey to him and his wife, Hattie B. Gatlin, the entire gore and a portion of the northeast quarter of Section 31 in Lauderdale County that was located west of Bluewater Creek. Subsequently, in May 1995, Gatlin discovered that Joiner was building improvements on the portion of the gore that Joiner's deed purported to include in his lot; Gatlin asked Joiner to cease building those improvements on the gore, but Joiner continued building them. Thereafter, the Neals began building improvements on the portion of the gore that their deed purported to include in their lot. In 1996, Gatlin brought a boundary-line action ("the boundary-line action") against Joiner and the Neals, seeking a determination that the section line was the boundary line between his land, on the one hand, and Joiner's and the Neals' land, on the other. Gatlin did not state any tort claims or claims seeking injunctive relief in the boundary-line action.
Joiner and the Neals admitted, in the boundary-line action, that Gatlin owned record title to the gore; however, they claimed that their predecessors in title had acquired ownership of the gore through adverse possession and had conveyed their ownership interests in the gore to Joiner and the Neals.
The boundary-line action went to trial on the sole issue whether Joiner and the Neals' predecessors in title had adversely possessed the gore. Having heard the evidence in a bench trial, the trial court, in August 1999, entered a judgment determining that Joiner and the Neals had not proved that their predecessors in title had adversely possessed the gore and that, therefore, the section line was the boundary line between Gatlin's land, on the one hand, and Joiner's and the Neals' land, on the other. Joiner and the Neals did not *129 appeal the judgment entered by the trial court in the boundary-line action.
In 1999, Joiner and the Neals, in separate actions ("the fraud actions") sued various defendants, stating claims of fraud based on the allegation that the defendants had misrepresented to Joiner and the Neals that the lots they were buying bordered on Bluewater Creek when, in fact, they were separated from Bluewater Creek by the gore, which Gatlin owned. Joiner and the Neals did not name Gatlin as a party in the fraud actions. The defendants in the fraud actions moved for summary judgments on the ground that there had been no misrepresentation because Joiner's and the Neals' predecessors in title had indeed owned record title to the gore and had conveyed it to Joiner and the Neals. The trial court granted the defendants' summary-judgment motions; Joiner and the Neals did not appeal those summary judgments.
On July 18, 2002, Gatlin brought the present action against Joiner, the Neals, and various other defendants.[1] Gatlin's original complaint stated claims of trespass, slander of title, ejectment, conversion, negligence, and wantonness and demanded a trial by jury. He later amended his complaint to add a claim seeking an easement by necessity and a claim seeking a permanent injunction enjoining Joiner and the Neals from trespassing on the gore in the future.
Answering Gatlin's complaint, as amended, Joiner and the Neals denied liability and asserted, as an affirmative defense, that Gatlin's trespass action was barred by the applicable statute of limitations. They did not assert, as an affirmative defense, that any of Gatlin's claims were barred by the doctrines of res judicata or collateral estoppel. Subsequently, Joiner and the Neals moved the trial court for a summary judgment on the ground that Gatlin could not prevail on his claims because, they said, he did not own title to a portion of the gore. In support of their summary-judgment motion, Joiner and the Neals submitted an affidavit signed by Clint Wilkes ("the Wilkes affidavit"), an employee of The Abstract & Title Company of Florence, Inc., which does business in Lauderdale County. In pertinent part, that affidavit stated:
"6. I recently reviewed the title to a tract of property owned by Thomas Wayne Gatlin and [his wife]. ... As stated in the [1995 deed in which Gatlin's parents conveyed this tract of property to Gatlin and his wife], this property is located in the Northeast Quarter of Section 31, Township 2 South, Range 8 West, in Lauderdale County, Alabama.[2] In addition to reviewing the title to this tract of property, I also reviewed the title to adjoining property located in the Northwest Quarter of Section 32, Township 2 South, Range 8 West, in Lauderdale County, Alabama.
"7. In reviewing the title to the property now owned by the Gatlins, I discovered that this property was originally owned by B.W. Cunningham and Turner Cunningham. On January 16, 1920, the Cunninghams conveyed an easement to the United States of America with a perpetual right to permanently flood all of that portion of the Northeast Quarter of Section 31, Township 2 South, Range 8 West, lying below the 505-foot contour line as referenced by a survey of the United States Engineers in 1895. ... The 505-foot contour line referenced in *130 this instrument was subsequently determined to have been erroneously established, and was actually the 509.34-foot elevation [contour] line adopted by the United States.[3]
"8. On January 25, 1943, the Cunninghams executed a deed in which they conveyed the east half of the Northeast Quarter of Section 31, Township 2 South, Range 8 to Willie E. Gibson. Excepted from this conveyance was all of that tract of land lying below the 505-foot [contour] line....
"9. After reviewing the above referenced instruments, I continued my search of the title to this tract of property. There were numerous conveyances of the property between 1943 and 1970, and none of those instruments excepted from their descriptions the property which the Cunninghams conveyed to the United States. In 1970, Julian A. Nance and Martha L. Nance conveyed the property to [Gatlin's parents]. ... Unlike the previous deeds, the description in this instrument was subject to the exception for the property previously conveyed by the Cunninghams to the United States. On November 18, 1970, [Gatlin's parents] conveyed 70 acres of this property to [Gatlin and his wife].[4]... Furthermore, the [1995] deed in which Thomas Wayne Gatlin and [his wife] obtained title to the [tract of] property [that included the gore] did not contain such an exception.
"10. The [title company I work for] has conducted title searches on the property owned by the Gatlins over the course of many years. Each and every abstract prepared by this company contained a reference to the conveyance from the Cunninghams to the United States of America. On March 30, 1995, [this company] updated its abstract for Mr. Gatlin. In the materials provided to Mr. Gatlin, the conveyance from the Cunninghams to the United States was shown. Furthermore, the conveyance from the Cunninghams to Mr. Gibson was shown, excepting the property previously conveyed to the United States. As a matter of public record, the title to the property owned by the Gatlins shows that, as of the conveyance from the Cunninghams to the United States, all property located within that legal description and lying below the 505-foot contour line (now 509.34-foot contour line) was not within their chain of title."
(Emphasis added.)
In opposition to Joiner and the Neal's summary-judgment motion, Gatlin asserted that, pursuant to the doctrine of res judicata, the judgment entered in the boundary-line action, which, he said, had determined that he owned the gore, barred Joiner and the Neals from contesting Gatlin's ownership of the gore in this action.
Following a hearing, the trial judge entered an order (1) granting the summary-judgment motion with respect to Gatlin's claims of slander of title, ejectment, conversion, and easement by necessity; (2) granting the motion with respect to Gatlin's trespass claim insofar as it was grounded on allegations that Joiner and the Neals had trespassed on the portion of the gore located below the 509.34-foot elevation contour line established by the federal government; and (3) denying the motion with respect to Gatlin's trespass claim *131 insofar as it was grounded on allegations that Joiner and the Neals had trespassed on the portion of the gore located above the 509.34-foot elevation contour line. The trial judge's order did not purport to rule on the summary-judgment motion with respect to Gatlin's claims of negligence and wantonness or his claim seeking a permanent injunction enjoining Joiner and the Neals from trespassing on the gore in the future.
Gatlin unsuccessfully petitioned the Alabama Supreme Court for permission to appeal the trial court's interlocutory order regarding Joiner and the Neals' summary-judgment motion. After the supreme court denied Gatlin's petition, the action proceeded to trial before a jury. After both sides had rested, the trial judge charged the jury with respect to Gatlin's trespass claim insofar as it sought damages grounded on allegations that Joiner and the Neals had trespassed on the portion of the gore located above the 509.34-foot elevation contour line; however, the trial judge did not charge the jury with respect to Gatlin's claims of negligence and wantonness. The jury returned a verdict in favor of Gatlin and against Joiner and the Neals but awarded Gatlin only nominal damages. The trial judge entered a judgment on the jury verdict but did not rule on Gatlin's claim seeking a permanent injunction enjoining Joiner and the Neals from trespassing on the gore in the future. Gatlin moved the trial judge to vacate the judgment he had entered on the jury's verdict and to grant Gatlin a new trial; however, the trial court denied that motion. Within 42 days after the denial of that motion, Gatlin filed a notice of appeal to the supreme court. The supreme court transferred Gatlin's appeal to this court pursuant to § 12-2-7(6), Ala.Code 1975. This court dismissed that appeal because the absence of a ruling on the claim seeking a permanent injunction deprived the trial court's judgment of finality. See Gatlin v. Joiner, 4 So.3d 1139 (Ala.Civ.App. 2008).
Following this court's dismissal of Gatlin's first appeal, the trial court entered an order granting Gatlin a permanent injunction enjoining Joiner and the Neals from trespassing in the future on the portion of the gore located above the 509.34-foot elevation contour line but denying him an injunction enjoining Joiner and the Neals from trespassing in the future on the portion of the gore located below the 509.34-foot elevation contour line. Gatlin filed a postjudgment motion challenging the partial denial of his claim seeking a permanent injunction, which the trial court denied. Gatlin then timely appealed to the supreme court, which transferred the appeal to this court pursuant to § 12-2-7(6).

Law and Analysis
Gatlin argues that the trial court erred insofar as it granted Joiner and the Neals' summary-judgment motion and denied his claim seeking a permanent injunction because, he says, the trial court based those rulings on evidence submitted by Joiner and the Neals that indicated that Gatlin did not own record title to the portion of the gore located below the 509.34-foot elevation contour line despite Joiner's and the Neals' being barred by the doctrine of res judicata from claiming that Gatlin did not own that portion of the gore. Joiner and the Neals concede that the doctrine of res judicata barred them from claiming that Gatlin did not own a portion of the gore; however, they argue (1) that the trial court did not have subject-matter jurisdiction over this action because, they say, indispensable parties were not joined in the action and (2) that the trial court's rulings should be affirmed on grounds other than Joiner and the Neals' claim that Gatlin did not own a portion of the gore.
*132 We will first address Joiner and the Neals' argument that the trial court did not have subject-matter jurisdiction over the action now before us because, they say, indispensable parties were not joined in the action. Specifically, Joiner and the Neals argue (1) that the United States is an indispensable party because, according to the Wilkes affidavit, the United States owns a perpetual easement allowing it to permanently flood the portion of the gore located below the 509.34-foot elevation contour line; (2) that the heirs of B.W. Cunningham and Turner Cunningham are indispensable parties because, according to the Wilkes affidavit, the Cunninghams retained title to the portion of the gore located below the 509.34-foot elevation contour line when they conveyed the rest of the gore to Willie E. Gibson in 1943 and, therefore, their heirs now own title to that portion of the gore; and (3) that Gatlin's children are indispensable parties because Gatlin testified at trial that, after the entry of the judgment in the boundary-line action, he had conveyed a remainder interest in the gore to his children and had retained only a life estate in the gore. In Byrd Cos. v. Smith, 591 So.2d 844 (Ala.1991), the Alabama Supreme Court stated:
"Rule 19, Ala. R. Civ. P., provides for joinder of persons needed for just adjudication. Its purposes include the promotion of judicial efficiency and the final determination of litigation by including all parties directly interested in the controversy. Hooper v. Huey, 293 Ala. 63, 69, 300 So.2d 100, 105 (1974), overruled on other grounds, Bardin v. Jones, 371 So.2d 23 (Ala.1979). Where the parties before the court adequately represent the absent parties' interests and the absent parties could easily intervene should they fear inadequate representation, no reason exists why the trial court could not grant meaningful relief to the parties before the court. Ross v. Luton, 456 So.2d 249, 257 (Ala.1984). Also, joinder of the absent parties is not absolutely necessary where determination of the controversy will not result in a loss to the absent parties' interest or where the action does not seek a judgment against them. Morgan Plan Co. v. Bruce, 266 Ala. 494, 497-98, 97 So.2d 805, 808 (1957). A defendant's delay and its self-serving purpose for raising the issue have also been held to be proper considerations in determining whether a judgment is proper in the absence of a particular party. J.R. McClenney & Son, Inc. v. Reimer, 435 So.2d 50, 52 (Ala.1983). See also, Geer Bros., Inc. v. Walker, 416 So.2d 1045, 1050 (Ala.Civ.App.1982).
"This Court has also held, however, that in cases where the final judgment will affect ownership of an interest in real property, all parties claiming an interest in the real property must be joined. Johnston v. White-Spunner, 342 So.2d 754, 759 (Ala.1977)."
591 So.2d at 846 (emphasis added).
In the action now before us, Gatlin neither seeks a judgment determining that his interest in the gore is superior to that of the United States, the Cunninghams' heirs, or his own children, nor does he seek a judgment against them. Indeed, he claims that, for purposes of the action now before us, his title to the gore was determined by the judgment in the boundary-line action, a judgment that is not binding on the United States, the Cunninghams' heirs, or Gatlin's children because they were not made parties to the boundary-line action. See Austin v. Alabama Check Cashers Ass'n, 936 So.2d 1014, 1040 (Ala. 2005) ("`It is a principle of general application in Anglo-American jurisprudence that one is not bound by a judgment in personam in a litigation in which he is not designated *133 as a party or to which he has not been made a party by service of process.' Hansberry v. Lee, 311 U.S. 32, 40, 61 S.Ct. 115, 85 L.Ed. 22 (1940)."). Moreover, Gatlin's children, as remaindermen, have no right to possession of the gore while Gatlin is alive, see Hinesley v. Davidson, 335 So.2d 380, 382 (Ala.1976) ("As remaindermen, plaintiffs have no right to possession until the death of the life tenant."); see also 51 Am.Jur.2d Life Tenants and Remaindermen § 2 (2000) ("A remainder interest takes effect in possession or enjoyment immediately upon the termination of the prior estate." (footnote omitted)), and, therefore, are not indispensable parties with respect to claims seeking to protect Gatlin's right to possession of the gore. See 51 Am.Jur.2d Life Tenants and Remaindermen § 3 (2000) ("Since a remainderman has no right to possession of the property until the particular prior estate is terminated, he or she has no right to recover the possession or to obtain compensation for injuries to the possession, both of which depend upon having the right of possession, until he or she is entitled to possession." (footnote omitted)). Accordingly, we conclude that, under the particular facts of the action now before us, the judgment of the trial court is not void due to the nonjoinder of the United States, the Cunninghams' heirs, or Gatlin's children.
We will next address Gatlin's argument that the trial court erred in partially granting Joiner and the Neals' summary-judgment motion and in partially denying his claim seeking a permanent injunction because, he says, the doctrine of res judicata barred Joiner and the Neals from claiming that Gatlin did not own a portion of the gore.
"The elements of res judicata, or claim preclusion, are (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 suits. Hughes v. Allenstein, 514 So.2d 858, 860 (Ala.1987). If those four elements are present, any claim that was or could have been adjudicated in the prior action is barred from further litigation."
Dairyland Ins. Co. v. Jackson, 566 So.2d 723, 725 (Ala.1990) (emphasis added). "`Res judicata applies not only to the exact legal theories advanced in the prior case, but to all legal theories and claims arising out of the same nucleus of operative facts.'" Old Republic Ins. Co. v. Lanier, 790 So.2d 922, 928 (Ala.2000) (quoting Wesch v. Folsom, 6 F.3d 1465, 1471 (11th Cir.1993)).
For purposes of res judicata, Joiner and the Neals prosecuted, in the boundary-line action, a cause of action seeking a determination that Gatlin did not own the gore.[5] Although the theory they asserted in the boundary-line action, i.e., that Gatlin did not own the gore because Joiner's and the Neals' predecessors in title had adversely possessed the gore, differed from the theory they asserted in the action now before us, i.e., that Gatlin did not own record title to the portion of the gore located below the 509.34-foot elevation contour line, both theories were encompassed within a single cause of action for purposes of res judicata. See Old Republic Ins. Co. v. Lanier, supra. Accordingly, *134 the doctrine of res judicata barred Joiner and the Neals from claiming that Gatlin did not own record title to the portion of the gore located below the 509.34-foot elevation contour line based on the easement granted the United States in 1920 and the Cunninghams' exception of that portion of the gore from their deed to Willie Gibson in 1943 because that claim could have been adjudicated in the boundary-line action. See Old Republic Ins. Co. v. Lanier, supra, and Dairyland Ins. Co. v. Jackson, supra.
However, Joiner and the Neals argue that, even though the doctrine of res judicata barred them from claiming in the action now before us that Gatlin did not own a portion of the gore, we should nonetheless affirm the trial court's judgment on other grounds.
"[T]his Court will affirm the trial court on any valid legal ground presented by the record, regardless of whether that ground was considered, or even if it was rejected, by the trial court. Ex parte Ryals, 773 So.2d 1011 (Ala.2000), citing Ex parte Wiginton, 743 So.2d 1071 (Ala. 1999), and Smith v. Equifax Servs., Inc., 537 So.2d 463 (Ala.1988). This rule fails in application only where due-process constraints require some notice at the trial level, which was omitted, of the basis that would otherwise support an affirmance, such as when a totally omitted affirmative defense might, if available for consideration, suffice to affirm a judgment. Ameriquest Mortgage Co. v. Bentley, 851 So.2d 458 (Ala.2002), or where a summary-judgment movant has not asserted before the trial court a failure of the nonmovant's evidence on an element of a claim or defense and therefore has not shifted the burden of producing substantial evidence in support of that element. Rector v. Better Houses, Inc., 820 So.2d 75, 80 (Ala.2001) (quoting Celotex Corp. v. Catrett, 477 U.S. 317, 323, 106 S.Ct. 2548, 91 L.Ed.2d 265 (1986), and Kennedy v. Western Sizzlin Corp., 857 So.2d 71 (Ala.2003))."
Liberty Nat'l Life Ins. Co. v. University of Alabama Health Servs. Found. P.C., 881 So.2d 1013, 1020 (Ala.2003).
Joiner and the Neals argue that we should (1) affirm the trial court's summary judgment with respect to Gatlin's trespass claim insofar as it was based on allegations that they had trespassed on the portion of the gore located below the 509.34-foot elevation contour line and (2) affirm the trial court's denial of Gatlin's claim seeking a permanent injunction insofar as it sought an injunction enjoining Joiner and the Neals from trespassing on the portion of the gore located below the 509.34-foot elevation contour line on the ground that Gatlin's trespass claim was barred by the applicable six-year statute of limitations. Because Joiner and the Neals pleaded the statute of limitations as an affirmative defense to Gatlin's trespass claim in their answers to his complaint, we could affirm the trial court's judgment on that ground if it is meritorious. See Liberty Nat'l Life Ins. Co. v. University of Alabama Health Servs. Found., supra. However, we conclude that it is not meritorious.
In Alabama Power Co. v. Gielle, 373 So.2d 851, 854 (Ala.Civ.App.1979), this court stated:
"A structure maintained on another's property is a continuing trespass. 87 C.J.S. Trespass § 13 (1954). A continuing trespass creates successive causes of action, and damages may be recovered for the trespass occurring within the statutory period. 13 Ala. Digest Limitation of Actions § 55(6); 54 C.J.S. Limitations of Actions § 169 (1948)."
In the action now before us, Gatlin claims that Joiner had trespassed on the portion of the gore located below the 509.34-foot elevation contour line by, among other *135 things, building a boat dock and a boat ramp, which Joiner allegedly refused to remove despite the entry of the judgment in favor of Gatlin in the boundary-line action. Gatlin claims that the Neals had trespassed on the portion of the gore located below the 509.34-foot elevation contour line by, among other things, building a boat dock. The building of those structures constituted a continuing trespass, and, therefore, the statute of limitations did not bar the recovery of damages for the trespass caused by those structures within six years of the date Gatlin filed his trespass action.
Joiner and the Neals also argue that we should affirm the trial court's summary judgment with respect to Gatlin's slander-of-title claim because, they say, that claim was barred by the applicable statute of limitations. However, we cannot affirm the trial court's summary judgment with respect to Gatlin's slander-of-title claim based on the statute of limitations because Joiner and the Neals failed to plead the statute of limitations as an affirmative defense to Gatlin's slander-of-title claim in their answers to Gatlin's complaint. See Liberty Nat'l Life Ins. Co. v. University of Alabama Health Servs. Found., supra.
In addition, Joiner and the Neals argue that we should affirm the trial court's summary judgment with respect to Gatlin's slander-of-title claim because, they say, he cannot prove some of the elements of that claim. However, Joiner and the Neals did not assert that alleged failure of Gatlin's evidence as a ground of their summary-judgment motion and, therefore, did not shift to Gatlin the burden of producing substantial evidence in support of those elements. Id. Consequently, we cannot affirm the summary judgment on the basis of the alleged failure of Gatlin's evidence with respect to those elements. Id.
Joiner and the Neals argue that we should affirm the trial court's summary judgment with respect to Gatlin's conversion claim because, they say, that claim seeks to recover for the taking of property that has become a fixture or a part of the real property and "[a]n action for conversion will not lie for the taking of real property, nor will it lie for the taking of personal property that has been incorporated into real property." Baxter v. SouthTrust Bank of Dothan, 584 So.2d 801, 805 (Ala.1991) (citations omitted). However, this argument asserts a failure of Gatlin's evidence regarding an element of his conversion claim, i.e., a taking of personal property. Because Joiner and the Neals did not assert that alleged failure of Gatlin's evidence as a ground of their summary-judgment motion, they did not shift to Gatlin the burden of producing substantial evidence in support of that element. See Liberty Nat'l Life Ins. Co. v. University of Alabama Health Servs. Found., supra. Therefore, we cannot affirm the trial court's summary judgment with respect to Gatlin's conversion claim on the basis of that alleged failure of Gatlin's evidence. Id.
Joiner and the Neals argue that we should affirm the trial court's summary judgment with respect to Gatlin's ejectment claim on the basis of an alleged failure of Gatlin's evidence regarding some of the elements of his ejectment claim. Once again, however, Joiner and the Neals did not assert the alleged failure of Gatlin's evidence with respect to those elements as a ground of their summary-judgment motion and, therefore, did not shift to Gatlin the burden of producing substantial evidence in support of those elements. Id. Consequently, we cannot affirm the trial court's summary judgment with respect to Gatlin's ejectment claim on the *136 basis of the alleged failure of Gatlin's evidence with respect to those elements. Id.
Accordingly, we reverse the trial court's judgment insofar as it granted Joiner and the Neals' summary-judgment motion and insofar as it denied Gatlin's claim seeking a permanent injunction, and we remand the action to the trial court for further proceedings consistent with this opinion.
REVERSED AND REMANDED.
THOMPSON, P.J., and PITTMAN, THOMAS, and MOORE, JJ., concur.
NOTES
[1]  Gatlin has not appealed the adverse dispositions of his claims against the other defendants.
[2]  The gore was contained within the tract of property described in this 1995 deed.
[3]  The easternmost .14 acre of the gore is located above the 509.34-foot elevation contour line; the balance of the gore is located below the 509.34-foot elevation contour line.
[4]  This 70-acre parcel was located in the western half of the northeast quarter of Section 31 and did not include the gore.
[5]  We do not have before us the issue whether any of Gatlin's claims in the action now before us are barred by the doctrines of res judicata or collateral estoppel because Joiner and the Neals did not plead the doctrines of res judicata or collateral estoppel as affirmative defenses in their answers to Gatlin's complaint. Subject to exceptions not here applicable, a party's failure to plead an affirmative defense in his or her answer waives that affirmative defense. See Robinson v. Morse, 352 So.2d 1355, 1356-57 (Ala.1977).
