The appellants, children of the appellee, challenge the trial court’s dismissal of their petition to establish a trust in their favor against their father. The trial court dismissed their claim based upon res judica-ta. We affirm.
The facts of this case are extensively covered in Jasser v. Saadeh, 97 So.3d 241 (Fla. 4th DCA 2012). Briefly, at the behest of his children, a professional guardian brought a petition to determine the incapacity of appellee, Karim Saadeh. The court appointed an emergency temporary guardian over the objection of Saadeh and removed all of his legal rights, except the right to vote. Despite this, the guardian and Saadeh’s appointed counsel had him sign an express trust, to which he transferred all of his assets. The trust was for his benefit during his lifetime with remainder to appellants, his children, who were also the trustees of the trust. After securing his own counsel, Saadeh contested the formation of the trust. He filed a petition to revoke the trust on various grounds, including lack of capacity. The children filed their own petition seeking a declaratory judgment as to the validity of the trust. The trial court concluded that because Saadeh lacked the legal capacity to *984enter the trust, it was void ab initio, a decision affirmed in Jasser v. Saadeh.
Shortly after the trial court’s decision, the children, in their capacity as trustees, filed a second declaratory judgment action against their father, again seeking to determine the validity of the trust, claiming that their father had intended to create a trust and that either a “common law” trust or a resulting trust arose. They also sought to join as plaintiffs the emergency temporary guardian and Saadeh’s appointed counsel in the incapacity proceedings, because counsel and the guardian were owed money for their services.1 Upon Saadeh’s motion to dismiss, the trial court dismissed the complaint based upon res judicata. This appeal ensued.
We review the trial court’s order dismissing the appellants’ complaint de novo. See MEBA Med. & Benefits Plan v. Logo, 867 So.2d 1184, 1186 (Fla. 4th DCA 2004).2
The doctrine of res judicata prevents the relitigation of causes of action previously determined. In Florida Department of Transportation v. Juliano, 801 So.2d 101, 105 (Fla.2001), the court explained:
[Ujnder the doctrine of res judicata:
A judgment on the merits rendered in a former suit between the same parties or their privies, upon the same cause of action, by a court of competent jurisdiction, is conclusive not only as to every matter which was offered and received to sustain or defeat the claim, but as to every other matter which might with propriety have been litigated and determined in that action.
Kimbrell v. Paige, 448 So.2d 1009, 1012 (F1a.l984)(emphasis supplied) (quoting Wade v. Clower, 94 Fla. 817, 114 So. 548, 552 (1927)). Based on principles of res judicata, a judgment on the merits will thus bar “a subsequent action between the same parties on the same cause of action.” Youngblood v. Taylor, 89 So.2d 503, 505 (Fla.1956) (emphasis supplied). Importantly, the doctrine of res judicata not only bars issues that were raised, but it also precludes consideration of issues that could have been raised but were not raised in the first case. See id.
(final emphasis supplied). This Court has explained that “[fjour identities are required for res judicata to be applicable to a case: ‘(1) identity of the thing sued for; (2) identity of the cause of action; (3) identity of the persons and parties to the actions; and (4) identity of the quality or capacity of the persons for or against whom the claim is made.’” Tyson v. Viacom, Inc., 890 So.2d 1205, 1209 (Fla. 4th DCA 2005) (quoting Freehling v. MGIC Fin. Corp., 437 So.2d 191, 193 (Fla. 4th DCA 1983)).
In this action all four identities are present. As to identity of the thing sued for, the children sued to establish the validity of a trust over the assets of their father in both the prior proceeding and this proceeding. As to identity of the cause of *985action, they sought a declaratory judgment to determine the validity of the trust executed by Saadeh and the management of the trust assets. At the least, the claims they raise in the second suit could have been brought in the first suit and could have been properly litigated in that suit.
As to the identity of the persons and parties to the action, in the first case, they sued individually, and in this case they sued in their capacity as trustees. “The term ‘parties’ has frequently been given a much broader coverage than merely embracing parties to the record of an action[.]” Seaboard Coast Line R.R. Co. v. Indus. Contracting Co., 260 So.2d 860, 863 (Fla. 4th DCA 1972). As the supreme court explained later, “[f]or one to be in privity with one who is a party to a lawsuit or for one to have been virtually represented by one who is party to a lawsuit, one must have an interest in the action such that she will be bound by the final judgment as if she were a party.” Stogniew v. McQueen, 656 So.2d 917, 920 (Fla. 1995) (citing Se. Fid. Ins. Co. v. Rice, 515 So.2d 240 (Fla. 4th DCA 1987)). The children, as trustees, fit within that broad definition. While the children also added their father’s corporation as a defendant because it was an asset of the void trust, it too can be considered a party for res judi-cata purposes.
Finally, the quality and capacity of the persons for and against whom the claim is made remain the same. In this case, the “real party in interest” on each side remained the same. We conclude that the court did not err in dismissing on the ground of res judicata.
In addition, we agree with Saadeh’s argument that the dismissal is the correct result for other reasons not expressed by the trial court but argued by Saadeh. The trust was void ab initio, not merely voidable. As such, no trust was created. If no trust was created by the document, it cannot be used to impose a trust over the objection of the settlor. No principle of law supports the proposition that a trustee or beneficiary of such a trust can sue the settlor to establish a trust for another person. Where a trust fails, a resulting trust may be created for the benefit of the set-tlor, so that the settlor receives back the assets which may have been transferred into the trust. See Restatement (Second) Trusts § 411. That was accomplished in the first suit, as the court ordered the return of all assets to Saadeh. Thus, not only is the prior suit res judicata of the claim, the relief granted — i.e., the return of all of Saadeh’s assets to him — is the relief authorized under a resulting trust theory and was accomplished in the first suit.
With a court having already declared the trust invalid and void, the matter is res judicata. Saadeh recovered his full legal rights two years ago. It remains his right to dispose of his property as he so chooses.
Affirmed.
STEVENSON, J., and STONE, BARRY J., Senior Judge, concur.. While appellants claim that the attorney and guardian should have been joined, they are not indispensible parties. See Pyle v. Pyle, 53 So.2d 312, 314 (Fla.1951). The court did not abuse its discretion in denying appellants’ motion for joinder.
. Although res judicata is usually raised in an answer, making it inappropriate for a motion to dismiss, “an exception is made when the face of the complaint is sufficient to demonstrate the existence of the defense.” Ramos v. Mast, 789 So.2d 1226, 1227 (Fla. 4th DCA 2001) (citing Bess v. Eagle Capital, Inc., 704 So.2d 621, 622 (Fla. 4th DCA 1997)). As the trial court noted, there are sufficient references in the complaint itself to the history of the entire matter so that the issue may be determined.