
369 A.2d 646 (1977)
Richard J. ISRAEL, Attorney General
v.
NATIONAL BOARD OF YOUNG MEN'S CHRISTIAN ASSOCIATION.
No. 75-89-Appeal.
Supreme Court of Rhode Island.
February 24, 1977.
*647 Julius C. Michaelson, Atty. Gen., Allen P. Rubine, Special Asst. Atty. Gen., for plaintiff.
Edwards & Angell, Jerry L. McIntyre, Terrence M. Finn, Providence, for defendant.

OPINION
DORIS, Justice.
The Attorney General brings this appeal from a judgment in Superior Court granting the motion of the defendant National Board of Young Men's Christian Association (the board) for summary judgment.
The Attorney General had sought an injunction in Superior Court to prevent the diversion of certain trust funds from their use in Newport, Rhode Island, to the general armed forces activities of defendant board throughout this country and abroad. The trial justice ruled that the decision of a New York court allowing diversion of the funds was entitled to "full faith and credit" in Rhode Island, and therefore granted defendant's motion for summary judgment.
The defendant board is a non-profit New York corporation with its principal office in New York City. It operates a number of facilities within the United States as well as abroad, and, since approximately 1910, has had a facility (the armed forces YMCA) in Newport, Rhode *648 Island, in a building owned by the board. However, in 1973, the board found it necessary to close this Newport branch because of the reduction of the number of armed forces personnel in Newport. There is a separate Newport YMCA presently in operation but it receives no funding from the board.
The legacies of three persons, each of whom was a Newport resident at the time of his death, comprise the funds in dispute. As to the smallest one of these legacies, that left by Julia W. Emmons,[1] the trial justice ruled it was an absolute bequest and not a charitable trust either as defined by G.L.1956 (1969 Reenactment) § 18-9-4 or under the common law as enunciated in Guild v. Allen, 28 R.I. 430, 67 A. 855 (1907). Therefore, he ruled that the Attorney General had no standing to seek cy pres application of the Emmons will.
As to the two other legacies, that of Henry F. Eldridge and that of Virginia Barrett Gibbs, both were left in trust to the board for the benefit of the armed forces YMCA in Newport.[2] The armed forces YMCA in Newport was closed late in 1973 following a large reduction in the number of naval personnel in Rhode Island. On May 21, 1974, the board, as trustee under the Eldridge and Gibbs wills, filed a petition in the Supreme Court of New York asking for permission to divert the funds from their use at the now-closed Newport branch to the general work of its armed services department throughout this country and abroad. The Attorney General of New York, as the representative of charitable beneficiaries under N.Y.Est., Powers & Trusts Law § 8-1.1 (McKinney 1967), endorsed the petition without objection on May 24, 1974. It was heard on May 30, 1974, and an order, under the authority of § 8-1.1(c), to divert the funds, was entered by the New York court on June 5, 1974.
The Attorney General of Rhode Island sought an injunction in Rhode Island Superior Court to prevent the diversion of these funds despite the fact that the New York Supreme Court had previously entered its order allowing the diversion. As noted above, the Superior Court trial justice ruled that the Attorney General had no standing to question the Emmons will since the legacy left to the YMCA was an absolute bequest and not a charitable trust. He also ruled that the New York order allowing diversion of the funds left by the Eldridge and Gibbs wills was entitled to *649 "full faith and credit" in Rhode Island. Therefore the request for an injunction was denied, and defendant board's motion for summary judgment was granted.[3]
On appeal it does not appear that the Attorney General seriously contests the decision on the Emmons will. In any event, we find no error in the trial justice's ruling that the fund left to the Newport YMCA in the Emmons will was an absolute bequest and not a charitable trust.
As to the Gibbs and Eldridge legacies, our initial inquiry is whether the Attorney General has the authority to bring this action, and whether the Rhode Island courts have jurisdiction to hear it. The trial justice found that § 18-9-1 does not give the Attorney General statutory authority to bring this action since it only authorizes enforcement of "charitable trusts within the state", and it is not disputed that both the trustee and the funds are located in New York and that the trust is being administered there. However, it is not necessary, for us to decide this question since, as the trial justice noted, there is ample authority indicating that the Attorney General has the common law authority to bring this action.
"It is well settled in this state and elsewhere that the attorney general is the representative of the interests of beneficiaries and the public under charitable trusts and bequests for charitable uses and that he should be made a party in any suit in which the existence or the validity of such a trust or such a bequest is really in question or the administration of such a trust is involved." Powers v. Home for Aged Women, 55 R.I. 187, 192, 179 A. 610, 612 (1935). Accord, Leo v. Armington, 74 R.I. 124, 59 A.2d 371 (1948); Newport Hosp. v. Harvey, 47 R.I. 382, 133 A. 648 (1926).
Thus, the Attorney General has the power and authority under the common law to enforce the provisions of charitable trusts affecting Rhode Island interests.
However, the fact that the Attorney General of Rhode Island has this power does not put an end to the controversy. The next question is whether this court has jurisdiction to consider the way in which the funds should now be used, and if so, whether that jurisdiction should be exercised.
Obviously the courts of this state originally had jurisdiction over the construction of the Eldridge and Gibbs wills by virtue of the fact that both parties died domiciled in the state of Rhode Island. See Rhode Island Hosp. Trust Co. v. Votolato, 102 R.I. 467, 231 A.2d 491 (1967). However, this situation changed when the Newport Probate Court authorized payment to the named trustee in New York. Where a bequest has been made in trust to a charity located in a jurisdiction foreign to that of the testator, the court of the testator's jurisdiction will merely order payment of the fund as directed and thereafter leave to the courts of the foreign jurisdiction the matter of seeing to the proper administration of the trust. Industrial Nat'l Bank v. Alexander von Stiftung, 105 R.I. 370, 252 A.2d 335 (1969).
"With respect to the share of the residuary clause under consideration, we exercise a limited form of jurisdiction. Since the designated charitable corporation is a nonresident, we make only an initial inquiry as to the use to which the funds will be put. See 5 Scott, Trusts (3d ed.), §§ 560, 569, 570. After doing so, if we feel reasonably certain that the donor's intention will be fulfilled, then we must direct the amount to be transferred *650 to the nonresident forthwith. By reasonably certain, we mean no more than a determination that the designated legatee is in existence and capable of administering the trust as directed." Id. at 378-79, 252 A.2d at 340.
Thus the New York courts had primary responsibility to oversee the administration of the charitable trusts created by the Eldridge and Gibbs wills. This is not to say that in the appropriate case the Rhode Island courts could not or should not take jurisdiction in the first instance despite the lack of exclusive jurisdiction. For example, a Rhode Island court might wish to exercise jurisdiction over a complaint by a Rhode Island beneficiary alleging misappropriation of funds by a foreign trustee of a charitable trust. However, here, the trustee of the charitable trust being administered in the foreign jurisdiction went to a competent court in that foreign jurisdiction and petitioned for permission to reallocate funds. The New York court, in its order, granted the requested permission.
Since this petition was brought and decided by a court of competent jurisdiction in New York prior to any action in Rhode Island, it is unnecessary for us to decide whether a similar action could have been commenced in Rhode Island in the first instance. We are limited to the question of whether the Rhode Island courts must now recognize the decision of the New York court in the face of an action by the Rhode Island Attorney General asking them not to do so. That is, whether the New York court's decision is entitled to "full faith and credit" under article IV of the United States Constitution. If the New York court's decision is entitled to "full faith and credit", then it is res judicata as to the question of allowing the diversion of funds by the New York trustee.
However, Rhode Island courts will not recognize foreign judgments if they are invalid or subject to collateral attack where rendered. Nevin v. Nevin, 88 R.I. 426, 149 A.2d 722 (1959). And we also "may make an inquiry as to whether the out-of-state court had jurisdiction over the parties and the subject matter of the controversy." Trustees of the Sheppard & Enoch Pratt Hosp. v. Smith, 114 R.I. 181, 183, 330 A.2d 804, 805 (1975).
Clearly the New York court had jurisdiction of the subject matter by virtue of the presence of the trustee and the trust funds in New York as well as the fact that the administration of the trusts was taking place in New York. However, the Attorney General is attacking the decision claiming that, as the representative of the Rhode Island beneficiaries, he was a "necessary party" who was not notified of the proceedings, and therefore the decision is not entitled to full faith and credit in Rhode Island.
In conflict of laws cases, this court has adopted a flexible, interest-weighing approach but has generally recognized the principle that the procedural law of the forum state applies even if a foreign state's substantive law is applicable. New York Est., Powers & Trusts Law § 8-1.1(c) (McKinney 1967), gives broad discretion to the New York Supreme Court in the procedural aspects of cy pres actions and requires only "notice as the court may direct." However, § 8-1.-4(e)(1) requires that notice be served on the Attorney General of New York whenever a cy pres petition is presented to the court. And § 8-1.1(f) makes the New York Attorney General the representative of beneficiaries of charitable trusts and requires him to represent and enforce their rights by appropriate proceedings in the courts. Nowhere is there any indication that the attorneys general of foreign jurisdictions must be notified or that they are "necessary parties" when the beneficiaries are foreign domiciliaries.[4] On cross motions *651 to allow the New York and Rhode Island attorneys general to become parties in a case involving a charitable trust in New York, the New York court allowed only the New York Attorney General to participate. Citing Trustees of Sailors' Snug Harbor in City of N. Y. v. Carmody, 158 App.Div. 738, 754-55, 144 N.Y.S. 24, 36-37 (1913), aff'd, 211 N.Y. 286, 105 N.E. 543 (1914), the court said: "Under the law of this State the attorney-general is the sole representative of indefinite charitable beneficiaries." National City Bank v. Beebe, 131 N.Y.S.2d 67, 75 (Sup.Ct.1954), aff'd, 285 App.Div. 874, 139 N.Y.S.2d 238, appeal dismissed, 308 N.Y. 960, 127 N.E.2d 100 (1955).
The Rhode Island Attorney General's argument that he was a "necessary party" to the New York cy pres proceeding thus finds no support either in New York statutory or case law. And it is clear from the record that the procedural steps specified in the New York statute were followed. The Attorney General of New York, the only "necessary party" according to New York law, was duly notified of the proceeding and endorsed the petition of the trustee.
Even if Rhode Island law applied to the notification process, it is clear that the Attorney General of Rhode Island was not a necessary party in the New York proceedings. Section 18-9-5 requires notification only for trusts located or administered within the state of Rhode Island.[5] As we noted above, these trusts were located and administered in New York and thus § 18-9-5 is inapplicable.
Finally, the Rhode Island Attorney General argues that even if the New York Attorney General is the sole representative of indefinite charitable beneficiaries, he breached his duty by not properly representing them and enforcing their rights, and therefore the New York proceedings are invalid. No evidence was presented to substantiate this claim which apparently is grounded in the allegation that the cy pres proceeding was completed in a summary fashion, without consulting Rhode Island authorities (i. e. the Rhode Island Attorney General).
While it might have been advisable for the New York Attorney General to consult with his Rhode Island counterpart and benefit from his familiarity and expertise with Rhode Island trust law, there is, as we noted above, no requirement that he do so. We certainly are not going to deny full faith and credit to the New York court's decision simply because the New York Attorney General did not consult every possible source of information in endorsing the cy pres petition. Insofar as the record before us discloses, it is clear that the Attorney General and the New York court followed the required steps in the cy pres proceeding. And it is not within our province to question whether the decision rendered was correct on the merits.[6] Therefore, we have no choice but *652 to deny the Attorney General's appeal and give full faith and credit to the New York decision which was rendered by a competent court having both subject matter and personal jurisdiction. If the Attorney General wishes to contest the New York Supreme Court's decision on its merits, then the proper place for that would be in the Appellate Courts of New York.
The Attorney General's appeal is denied and dismissed, the judgment appealed from is sustained and the case is remanded to the Superior Court.
NOTES
[1]  In article fifth, clause (27), Julia W. Emmons left "[t] o the Young Men's Christian Association, Newport, Rhode Island, the sum of Two Thousand ($2,000.00) Dollars."
[2]  The will of Henry F. Eldridge provided, in the eighth clause, for the residue of his estate to be divided into three equal shares. Two of these shares were put in trust during the lifetime of certain named beneficiaries, and thereafter the trustee was to:

" * * * convey, transfer, deliver and pay over the capital of such trust estate with all gains and increase of capital thereof if any in fee simple and absolutely in equal shares to said Newport Hospital and to the International Committee of Young Men's Christian Associations a corporation organized under the laws of the State of New York for use either as to principal or interest in its work at Newport Rhode Island with the men of the United States Army and Navy and the receipt of the
Treasurer thereof shall be a sufficient discharge to my Executor for the same
* * *."
The will of Virginia Barrett Gibbs provided, in the twelfth clause, for one-tenth of the residue of her estate to be given to "the International Committee of Young Men's Christian Association, Army and Navy Branch, New York, absolutely * * *." However a later codicil modified this legacy and provided as follows:
"Tenth: I hereby modify the provisions of the twelfth or residuary clause of my will, as follows:
1. The one-tenth part thereof given to the International Committee of Young Men's Christian Association, Army and Navy Branch, New York, I provide shall be used and applied by said institution solely and absolutely for the Newport Branch thereof, located on Washington Square in said City of Newport * * * ".
[3]  The defendant actually filed a motion to dismiss and attached materials which were extraneous to the complaint. The plaintiff also introduced documentary evidence and the trial justice, under the authority of Super. R.Civ.P. 12(b), treated the motion to dismiss as a motion for summary judgment under Rule 56.
[4]  Such a rule would certainly cause chaos and interfere with the orderly administration of charitable trusts if the beneficiaries of a charitable trust were scattered throughout the fifty states and the Attorney General of each state where a beneficiary might exist was a necessary party to any cy pres proceeding in the state where the trustee was administering the charitable trust funds.
[5]  General Laws 1956 (1969 Reenactment) § 18-9-5 reads as follows:

"Notice to attorney-general of proceedings affecting charitable trust.The attorney-general shall be notified of all judicial proceedings affecting, or in any manner dealing with, a charitable trust or affecting, or in any manner dealing with, a trustee who holds in trust within the state property given, devised or bequeathed for charitable, educational or religious purposes, and who administers or is under a duty to administer the same in whole or in part for said purposes within the state, and shall be deemed to be an interested party thereto." (Emphasis added.)
[6]  While the courts of this state might have come to a different conclusion on the merits of the cy pres proceeding if it had initially been instituted in Rhode Island, this does not affect the enforcement of the New York proceeding. We are limited to the question of whether New York had jurisdiction of the matter and rendered a valid order, and cannot, regardless of our own opinions, question the merits of their decision.
