1 EXHIBIT 5 [LETTERHEAD OF LATHAM & WATKINS] December 5, 1997 IDEX Corporation 630 Dundee Road Northbrook, Illinois 60062 Re: $250,000,000 Aggregate Offering Price of Securities of IDEX Corporation Ladies and Gentlemen: In connection with the registration statement on Form S-3 (the "Registration Statement") filed on December 5, 1997 with the Securities and Exchange Commission (the "Commission") under the Securities Act of 1933, as amended (the "Securities Act"), you have requested our opinion with respect to the matters set forth below. You have provided us with a draft prospectus (the "Prospectus") which is a part of the Registration Statement. The Prospectus provides that it will be supplemented in the future by one or more supplements to the Prospectus (each, a "Prospectus Supplement"). The Prospectus as supplemented by various Prospectus Supplements will provide for the registration by IDEX Corporation, a Delaware corporation (the "Company"), of up to $250,000,000 aggregate offering price of (i) unsecured debt securities (the "Debt Securities"), (ii) warrants to purchase Debt Securities (the "Debt Warrants"), (iii) shares of preferred stock, $.01 par value per share (the "Preferred Stock"), (iv) warrants to purchase shares of Preferred Stock (the "Preferred Stock Warrants"), (v) shares of common stock, $.01 par value per share (the "Common Stock"), and (vi) warrants to purchase shares of Common Stock (the "Common Stock Warrants" and collectively with the Debt Warrants and the Preferred Stock Warrants, the "Warrants"). The Debt Securities, the Preferred Stock, the Common Stock and the Warrants are collectively referred to as the "Securities." Any Debt Securities may be exchangeable for or convertible into 2 IDEX Corporation December 5, 1997 Page 2 shares of Preferred Stock or Common Stock. Any Preferred Stock may be exchangeable for or convertible into shares of Common Stock. The Debt Securities may be issued pursuant to one or more indentures and one or more supplements thereto (collectively, the "Indentures"), in each case between the Company and a trustee (each, a "Trustee"). The Warrants may be issued pursuant to one or more agreements and one or more supplements thereto (collectively, the "Warrant Agreements"), in each case between the Company and an agent (each, a "Warrant Agent"). In our capacity as your special counsel in connection with the Registration Statement, we are generally familiar with the proceedings taken and proposed to be taken by the Company in connection with the authorization and issuance of the Securities. For purposes of this opinion, we have assumed that such proceedings will be timely and properly completed, in accordance with all requirements of applicable federal, Delaware and New York laws, in the manner presently proposed. We have made such legal and factual examinations and inquiries, including an examination of originals and copies certified or otherwise identified to our satisfaction of all such documents, corporate records and instruments of the Company, as we have deemed necessary or appropriate for purposes of this opinion. In our examination, we have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as originals, and the conformity to authentic original documents of all documents submitted to us as copies. We have obtained and relied upon, to the extent we deem appropriate, certificates of officers or other executives of the Company and of public officials as to factual matters. We are opining herein as to the effect on the subject transaction only of the General Corporation Law of the State of Delaware and with respect to opinion paragraphs (1) and (2) below, the internal laws of the State of New York, and we express no opinion with respect to the applicability thereto, or the effect thereon, of the laws of any other jurisdiction or, in the case of Delaware, any other laws, or as to any matters of municipal law or the laws of any local agencies within any state. Subject to the foregoing and the other qualifications set forth herein, as of the date hereof, it is our opinion that: 1. When the Debt Securities (including any Debt Securities issuable upon exercise of Debt Warrants) have been duly established in accordance with the terms of the applicable Indenture, duly authenticated by the applicable Trustee and duly executed and delivered by or on behalf of the Company against payment therefor in accordance with the terms and provisions of the applicable Indenture and as contemplated by the Registration Statement, the Prospectus and the related Prospectus Supplement, then (i) assuming that the terms of the Debt Securities as executed and delivered are as described in the Registration Statement, the 3 IDEX Corporation December 5, 1997 Page 3 Prospectus and the related Prospectus Supplement, (ii) assuming that the Debt Securities as executed and delivered do not violate any law applicable to the Company or result in a default under or breach of any agreement or instrument binding upon the Company, and (iii) assuming that the Debt Securities as executed and delivered comply with all requirements and restrictions, if any, applicable to the Company, whether imposed by any court or by any governmental or regulatory body having jurisdiction over the Company, the Debt Securities will constitute legally valid and binding obligations of the Company, enforceable against the Company in accordance with their terms. 2. When the Warrants have been duly authorized by adoption of a resolution by the Board of Directors, and executed and delivered by or on behalf of the Company against payment therefor in accordance with the terms and provisions of the Warrant Agreement to which they are subject and as contemplated by the Registration Statement, assuming that the terms of the Warrants as executed and delivered are as described in the Registration Statement, the Prospectus and the related Prospectus Supplement, then the Warrants will be validly issued. 3. Upon adoption by the Board of Directors of the Company of a resolution in form and content as required by applicable law (including adoption and filing of a Certificate of Designation or other Amendment to the Company's Restated Certificate of Incorporation designating the terms of such Preferred Stock) that authorizes the issuance of such Preferred Stock within the authorized number of shares of Preferred Stock then specified in the Company's Restated Certificate of Incorporation, as amended, after giving effect to any then outstanding Preferred Stock and reservation of Preferred Stock by the Board of Directors, and upon issuance and delivery of and payment for such shares in the manner contemplated by the Registration Statement, the Prospectus and the related Prospectus Supplement and by such resolution, assuming that the terms of the Preferred Stock as executed and delivered are as described in the Registration Statement, the Prospectus and the related Prospectus Supplement, such shares of Preferred Stock (including any Preferred Stock duly issued upon the exchange or conversion of validly issued Debt Securities that are exchangeable for or convertible into Preferred Stock or upon exercise of validly issued Warrants) will be validly issued, fully paid and nonassessable. 4. Upon adoption by the Board of Directors of the Company of a resolution in form and content as required by applicable law that authorizes the issuance of such Common Stock within the authorized number of shares of Common Stock then specified in the Company's Restated Certificate of Incorporation, as amended, after giving effect to any then outstanding Common Stock and reservation of Common Stock by the Board of Directors, and upon issuance and delivery of and payment for such shares in the manner contemplated by the Registration Statement, the Prospectus and the related Prospectus Supplement and by such resolution, assuming that the terms of the Common Stock as executed and delivered are as described in the Registration Statement, the Prospectus and the related Prospectus Supplement, such shares of 4 IDEX Corporation December 5, 1997 Page 4 Common Stock (including any Common Stock duly issued upon the exchange or conversion of validly issued Debt Securities that are exchangeable for or convertible into Common Stock or upon the exercise of validly issued Warrants) will be validly issued, fully paid and nonassessable. The opinions set forth in paragraphs (1) and (2) above are subject to the following exceptions, limitations and qualifications: (i) we express no opinion with respect to the effect of bankruptcy, insolvency, reorganization, moratorium or other similar laws now or hereafter in effect relating to or affecting the rights and remedies of creditors; (ii) we express no opinion with respect to the effect of general principles of equity, regardless of whether enforcement is considered in a proceeding in equity or at law, and the discretion of the court before which any proceeding therefor may be brought; (iii) we express no opinion with respect to the unenforceability under certain circumstances under law or court decisions of provisions providing for the indemnification of, or contribution to, a party with respect to a liability where such indemnification or contribution is contrary to public policy; (iv) we express no opinion concerning the enforceability of any waiver of rights or defenses with respect to stay, extension or usury laws; and (v) we express no opinion with respect to whether acceleration of Debt Securities may affect the collectibility of any portion of the stated principal amount thereof which might be determined to constitute unearned interest thereon. We assume for the purposes of this opinion that the Registration Statement and any required post-effective amendments thereto will have become effective under the Securities Act; the Company has been duly incorporated and is validly existing as a corporation under the laws of the State of Delaware and has the corporate power and authority to issue and sell the Securities; the applicable Indentures will have been duly authorized by all necessary corporate action by the Company, duly executed and delivered by the Company and will constitute legally valid and binding obligations of the Company enforceable against the Company in accordance with their terms; the Trustee under each Indenture is duly organized, validly existing and in good standing under the laws of its jurisdiction of organization; the Trustee under each Indenture is duly qualified to engage in the activities contemplated by the applicable Indenture; each Indenture will have been duly authorized, executed and delivered by the applicable Trustee and will constitute a legal, valid and binding obligation of such Trustee, enforceable against such Trustee in accordance with its terms; the Trustee under each Indenture is in compliance, generally and with respect to acting as Trustee under the applicable Indenture, with all applicable laws and regulations; and the Trustee under each Indenture has the requisite organizational and legal power and authority to perform its obligations under the applicable Indenture. We assume for purposes of this opinion that the applicable Warrant Agreements will have been duly authorized by all necessary corporate action by the Company, duly executed and delivered by the Company and will constitute legally valid and binding obligations of the Company enforceable against the Company in accordance with their terms; the Warrant Agent 5 IDEX Corporation December 5, 1997 Page 5 under each Warrant Agreement is duly organized, validly existing and in good standing under the laws of its jurisdiction of organization; the Warrant Agent under each Warrant Agreement is duly qualified to engage in the activities contemplated by the applicable Warrant Agreement; each Warrant Agreement will have been duly authorized, executed and delivered by the applicable Warrant Agent and will constitute a legal, valid and binding obligation of such Warrant Agent, enforceable against such Warrant Agent in accordance with its terms; the Warrant Agent under each Warrant Agreement is in compliance, generally and with respect to acting as Warrant Agent under the applicable Warrant Agreement, with all applicable laws and regulations; and the Warrant Agent under each Warrant Agreement has the requisite organizational and legal power and authority to perform its obligations under the applicable Warrant Agreement. We consent to your filing this opinion as an exhibit to the Registration Statement and to the reference of our firm under the caption "Legal Matters" in the Prospectus included therein. Very truly yours, /s/ Latham & Watkins