If a claim or defense is founded upon a written instrument, a copy thereof, or of so much of the same as is relevant, must be attached to the pleading as an exhibit or recited therein, unless the pleader attaches to his or her pleading an affidavit stating facts showing that the instrument is not accessible to him or her. In pleading any written instrument a copy thereof may be attached to the pleading as an exhibit. In either case the exhibit constitutes a part of the pleading for all purposes.
735 ILCS 5/2-606