
147 Cal.App.3d 225 (1983)
195 Cal. Rptr. 53
ROBERT E. KERIVAN et al., Plaintiffs and Appellants,
v.
TITLE INSURANCE AND TRUST COMPANY, Defendant and Respondent.
Docket No. 68629.
Court of Appeals of California, Second District, Division Four.
September 22, 1983.
*227 COUNSEL
Baum & Cohen and Arthur Jarvis Cohen for Plaintiffs and Appellants.
Helen V. Byard, John MacMillan, James Brenner and Barbara Janas for Defendant and Respondent.
OPINION
SCHNEIDER, J.[*]
This is an appeal from an order of dismissal entered after a demurrer to the complaint was sustained without leave to amend.


*228 FACTS
Robert E. Kerivan and K and W Trucking Company, Inc. (hereinafter collectively appellants) filed and served a complaint containing two causes of action, negligence and breach of fiduciary duty. The sole defendant is the Title Insurance and Trust Company (hereinafter respondent).
The first cause of action for negligence alleges that: appellants executed a note, secured by a deed of trust; respondent was the trustee; procedures for default and a nonjudicial foreclosure sale of the real property occurred; a trustee's deed was executed in favor of the beneficiary; the note was not canceled by the respondent, but delivered to the beneficiary and then was used in obtaining a deficiency judgment against appellants in the State of Colorado; contrary to the laws of this state (Code Civ. Proc., § 580d) the failure to cancel the note and delivery of the note to the beneficiary were wrongful and negligent; and as a proximate result of respondent's failure to cancel the note, appellants sustained damages. The second cause of action incorporates all of the allegations of the first cause of action. In addition thereto, appellants allege that respondent was a fiduciary which wilfully and intentionally breached its fiduciary duty, and appellants seek punitive damages. The complaint incorporates by reference numerous exhibits.[1]
A general demurrer by the respondent was filed bottomed on the argument that under the substantive law of this state the respondent cannot be negligent. The demurrer requested the trial court to take judicial notice of a case then pending in the Los Angeles Superior Court, for the purpose of showing that the deficiency judgment obtained by respondent in the State of Colorado was final. This appeal follows the sustaining of the general demurrer without leave to amend. Appellants contend that the complaint alleges sufficient facts to state the causes of action against respondent.


*229 I
The standards of review for measuring the validity of a pleading that has not withstood a demurrer are well established. (1) A demurrer can be used only to challenge defects that appear on the face of the pleading under attack or from matters outside the pleading that are judicially noticeable. No other extrinsic evidence can be considered. (Ion Equipment Corp. v. Nelson (1980) 110 Cal. App.3d 868 [168 Cal. Rptr. 361].) (2) For the purpose of testing the sufficiency of the cause of action, the demurrer admits the truth of all material facts properly pleaded. (Serrano v. Priest (1971) 5 Cal.3d 584 [96 Cal. Rptr. 601, 487 P.2d 1241].) The sole issue raised by a general demurrer is whether the facts pleaded state a valid cause of action, not whether they are true. No matter how unlikely or improbable, plaintiff's allegations must be accepted as true for the purpose of ruling on the demurrer. (Meyer v. Graphic Arts International Union (1979) 88 Cal. App.3d 176 [151 Cal. Rptr. 597].) Furthermore, plaintiff's possible inability or difficulty in proving the allegations of the complaint is of no concern. (Gruenberg v. Aetna Ins. Co. (1973) 9 Cal.3d 566 [108 Cal. Rptr. 480, 510 P.2d 1032].)

II
We first must ascertain the status and duties of a trustee under a deed of trust. (3) In Woodworth v. Redwood Empire Sav. & Loan Assn. (1971) 22 Cal. App.3d 347, 366 [99 Cal. Rptr. 373], the court stated as follows: "It is well established, however, that a trustee under a deed of trust is not a trustee in the technical sense. Rather, he is the agent of all the parties to the escrow at all times prior to performance of the conditions of the escrow and bears a fiduciary relationship to each of them. His obligation to each is measured by an application of the ordinary principles of agency." As an agent, the trustee may be liable for negligence. This principle was found applicable in Munger v. Moore (1970) 11 Cal. App.3d 1, 7 [89 Cal. Rptr. 323], wherein the court stated: "That rule is that a trustee or mortgagee may be liable to the trustor or mortgagor for damages sustained where there has been an illegal, fraudulent or wilfully oppressive sale of property under a power of sale contained in a mortgage or deed of trust." (4) An agent has the duty to use reasonable skill and diligence and if he violates this duty, he is liable for any loss which his principal may sustain as the result of his negligence. (Dahl-Beck Electric Co. v. Rogge (1969) 275 Cal. App.2d 893 [80 Cal. Rptr. 440].)

III
The next issue presented in this appeal is whether the trustee has a duty to cancel the note following a nonjudicial foreclosure sale, or whether circumstances *230 may exist wherein the note need not be canceled, and ancillary or supplementary actions may be brought in a sister state following a nonjudicial foreclosure sale. (5) "A deed of trust is a contract wherein mutual obligations are imposed upon the trustor, the trustee, and the beneficiary." Touli v. Santa Cruz County Title Co. (1937) 20 Cal. App.2d 495, 499 [67 P.2d 404].) Consequently, its terms ascertain the rights and duties of each party. (6) A note and a deed of trust are separate instruments and need not contain all of the terms of the agreement between the parties. California Civil Code section 1642 provides as follows: "Several contracts relating to the same matters, between the same parties, and made as parts of substantially one transaction, are to be taken together." (See also Huckell v. Matranga (1979) 99 Cal. App.3d 471 [160 Cal. Rptr. 177].) A note and a deed of trust, although two instruments, form parts of one transaction and must be read and construed together. (Mutual Bldg. & Loan Assoc. v. Beers (1931) 117 Cal. App. 200 [3 P.2d 565].) (7a) Since the deed of trust specified the applicable law to be that of this state and the note pertaining to the deed of trust indicated that it be construed under the laws of the State of Colorado, a patent ambiguity exists. Under these circumstances, there is a need for the trial court to look to the instruments involved, the surrounding circumstances, and the construction placed upon the instruments by the parties themselves. (Burns v. Peters (1936) 5 Cal.2d 619 [55 P.2d 1182].) The trial court's finding on this issue is essential to the resolution of this case.

IV
We next turn to the more difficult issue raised in this appeal. Appellants contend that a note executed and construed in a state allowing deficiency judgments, which is secured by a deed of trust affecting real property in this state, must nevertheless be canceled following a nonjudicial foreclosure sale. Unquestionably, Code of Civil Procedure section 580d sets forth the public policy of this state. It provides, unequivocally, that no judgment may be rendered for any deficiency on a note secured by a trust deed or mortgage, where the real property has been sold under a power of sale contained in the instrument. This antideficiency legislation has been given a broad and liberal construction. (Prunty v. Bank of America (1974) 37 Cal. App.3d 430 [112 Cal. Rptr. 370].) Thus, if the trial court ascertained that this note and the deed of trust were to be construed under the laws of this state, the trustee was duty-bound to cancel the note and no deficiency judgment was thereafter appropriate.
The beneficiary of the note secured by the deed of trust sought and obtained a deficiency judgment in the State of Colorado, which jurisdiction applied its own law.[2] Does the expression of public policy in this state have *231 extraterritorial effect preventing a nonresident beneficiary from seeking a deficiency judgment in a sister state? If the answer to this issue is in the negative, then the trustee was not obligated to cancel the note, and a deficiency judgment in Colorado was appropriate.
No California case deals with this issue. Restatement Second Conflict of Laws, section 229, comment e, states as follows: "Issues which do not affect any interest in the land, although they do relate to the foreclosure, are determined ... by the law which governs the debt for which the mortgage was given. Examples of such latter issues are the mortgagee's rights to hold the mortgagor liable for any deficiency remaining after foreclosure or to bring suit upon the underlying debt without having first proceeded against the mortgaged land."
Consistent with this Restatement section, a number of cases outside of this state held that a foreign antideficiency statute at the situs of the mortgaged property, would not protect the mortgagee against an in personam deficiency action in the forum. The basis of these decisions was to the effect that a foreign statute does not extinguish the permissible deficiency, but merely limits the remedy. The remedial measure in one state would not prevent a recovery of the deficiency in another state. (Martin v. Midgett (1966) 100 Ariz. 284 [413 P.2d 754]; Bayside-Flushing Gardens Inc. v. Beuermann (D.D.C. 1941) 36 F. Supp. 706.)
We distinguish Younker v. Reseda Manor (1967) 255 Cal. App.2d 431 [63 Cal. Rptr. 197], on the basis that the plaintiff therein sought to obtain a deficiency judgment in California on a note and deed of trust executed under the laws of Nevada following a foreclosure in that state. The summary judgment rendered by the trial court was reversed on the basis that Code of Civil Procedure section 580b was applicable. (8) The "judgment" referred to in Code of Civil Procedure sections 580b and 580d refers only to a judgment rendered in this state and not to a judgment pursued in a state allowing deficiencies following foreclosure sales.
(7b) Based upon the foregoing, we conclude that the trustee under a deed of trust has a duty to cancel the note following a nonjudicial foreclosure in this state, whenever the laws of this state are applicable to the transaction, but need not cancel the note when the beneficiary may seek a deficiency judgment in a jurisdiction other than ours. Appellants' complaint alleges that respondent's duty to cancel the note herein arises out of a statutory duty expressed in Code of Civil Procedure section 580d. Notwithstanding such allegation, exhibit "A" of the complaint refers to the law of the State of Colorado. The order sustaining the demurrer was proper, but leave to *232 amend should have been granted, as appellant may be able to amend the complaint to state a cause of action.
The order of dismissal is reversed for further proceedings consistent with this opinion.
Kingsley, Acting P.J., and McClosky, J., concurred.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
[1]  Exhibit "A," a promissory note which indicates that such note shall be "... construed under and governed by the laws of Colorado."

Exhibit "B," the first page only of a deed of trust recorded in the State of California and designating property located in this state. Appellants in their brief make reference to the fact that the deed of trust was governed and construed in accordance with the laws of the State of California. There is nothing in this record to support this statement. The records in case No. C 367468, to which the trial court's attention was directed by virtue of the request for judicial notice, does indicate that the deed of trust was to be governed by the laws of this state.
Exhibit "C," a declaration of default.
Exhibit "D," a notice of default and election to sell under deed of trust.
Exhibit "E," a trustee's deed upon sale.
The other exhibits pertain to the deficiency judgment and its finality in the State of Colorado.
[2]  The note which was not canceled by the respondent was apparently in evidence and formed the basis of the deficiency judgment in the State of Colorado.
