<PAGE>
                                                                   Exhibit 10.17

                                [XENOPORT LOGO]

May 4, 2001

William G. Harris
120 Croydon Way
Woodside, CA  94062

Dear Bill:

      On behalf of XenoPort, Inc. (the "Company"), I am pleased to invite you to
join the Company as Senior Vice President of Finance and Chief Financial
Officer. In this position, you will report directly to me and you will be
expected to devote all of your business time, attention and energies to the
performance of your duties with the Company. The effective date of your
employment will be July 2, 2001. It is understood that you will work on a part
time basis beginning July 2, 2001 and convert to full-time on November 1, 2001.

      The terms of this offer of employment are as follows:

      1. Salary. Commencing upon your full-time employment on November 1, 2001,
the Company will pay you a salary of $9,375.00 payable bi-monthly (corresponding
to an annual salary of $225,000) in accordance with the Company's standard
payroll policies. The first and last payment by the Company to you will be
adjusted, if necessary, to reflect a commencement or termination date other than
the first or last working day of a pay period.

      2. Benefits. Commencing upon your full-time employment on November 1,
2001, you will be entitled during the term of your employment to the Company's
standard vacation and benefits covering employees, as such may be in effect from
time to time. The current summary of the XenoPort benefits program is attached
to this letter.

      3. Stock Option. Subject to approval by the Company's Board of Directors,
you will be granted an option to purchase 500,000 shares of the Company's Common
Stock at the fair market value on the date the Board approves the option grant.
Twenty-five percent (25%) of the shares subject to the option will vest on the
first anniversary the effective date (July 2, 2001) of your employment with the
Company and an additional one forty-eighth (1/48th) of such shares will vest
each month thereafter, subject to your continued employment with the Company on
any such date.

      4. Bonus. Should you agree to the effective date of July 2, 2001 with your
full-time employment beginning November 1, 2001, the Company will offer you the
following:

            a.    A sign-on bonus in the amount of $10,000.00 (subject to
                  applicable payroll taxes) to be payable on the first payroll
                  cycle following the effective date. If you choose to
                  voluntarily terminate your employment within twelve months
                  following the effective date of employment, you agree to
                  promptly repay this bonus.

                                       1.
<PAGE>

            b.    The Company will permit you to exercise your stock option
                  pursuant to a Restricted Stock Purchase Agreement and to pay
                  the exercise price (estimated to be approximately $125,000,
                  based on the current fair market value of the Company's Common
                  Stock) with a full recourse promissory note that is secured by
                  a pledge of the XenoPort Common Stock owned by you upon
                  exercise of the above mentioned stock option. The loan
                  (principal and interest) will to be payable in 5 years or upon
                  termination as set forth in Exhibit A. A copy of the form
                  documents relating to this option exercise and promissory note
                  are attached as Exhibit A.

      5. Housing Loan. The Company will issue you a loan secured by a deed of
trust on your principle residence in a principal amount of up to $100,000 (see
Exhibit B). As long as you remain employed with the Company, the interest due on
this loan will be forgiven on an annual basis. The loan will have a seven year
term and will bear interest at an annual rate equal to the adjusted federal
long-term rate in effect on the date the loan is made or will become due upon
termination as set forth in Exhibit B. The principal amount of the loan will be
due in a single balloon payment at the end of such term. You will be responsible
for any applicable federal and state taxes associated with forgiven interest on
this loan.

      6. At-Will Employment. You should be aware that your employment with the
Company is for no specified period and constitutes "at-will" employment. As a
result, you are free to terminate your employment at any time, for any reason or
for no reason. Similarly, the Company is free to terminate your employment at
any time, for any reason or for no reason. Except as provided in Section 7, if
your employment terminates for any reason, you shall not be entitled to any
payments, benefits, damages, awards or compensation.

      7. Severance Upon Change of Control and Termination Without
Cause/Constructive Termination. If, within 12 months following a Change of
Control (defined below) of the Company, your employment with the Company is
terminated without Cause (defined below) or you are subject to Constructive
Termination (defined below), the Company shall provide you with the following:
(i) continued base salary existing at the time of termination for a period of 12
months following the date of termination and continued benefits existing at the
time of termination until the earlier of (a) 12 months from the date of
termination or (b) the date on which you become employed by another company as a
regular employee; and (ii) immediate vesting of the unvested portion of all
options or the unvested portion of the stock issued upon the exercise of such
options.

      "Change of Control" shall mean a merger or reorganization of the Company
with or into any other corporation or corporations or a sale of all or
substantially all of the assets of the Company, in which transaction the
Company's stockholders immediately prior to such transaction beneficially own
immediately after such transaction less than 50% of the equity securities of the
surviving corporation or its parent.

      "Cause" shall mean (i) a material failure to perform the duties associated
with your position as determined in good faith by the Company's board of
directors not cured within 30 days of written notice thereof; (ii) your
personally engaging in conduct that you reasonably should know or that you
intend to be seriously injurious to the Company, its affiliates or its
stockholders; (iii) a material and willful violation of a federal or state law
or regulation applicable to the business of the Company; (iv) your conviction of
a felony under the laws of the United States or any State, or the
misappropriation of material property belonging to, the

                                       2.
<PAGE>

Company or its affiliates; or (v) your knowingly and intentionally breaching in
any material respect the terms of your Employee Proprietary Information
Agreement.

      "Constructive Termination" shall mean your resignation of employment with
the Company following either (i) a substantial reduction in your duties,
responsibilities or actions, without your express written consent, (ii) a
substantial downward change in your compensation or benefits, except for
compensation and benefit changes which are consistent with downward changes for
all Company executives, or (iii) a change in location of employment of greater
than 50 miles from the then current location, without your express written
consent.

      8. Proprietary Information Agreement. As a condition of accepting this
offer of employment, you will be required to complete, sign and return the
Company's standard form of Employee Proprietary Information Agreement (attached
to this letter).

      9. Immigration Laws. For purposes of federal immigration laws, you will be
required to provide to the Company documentary evidence of your identity and
eligibility for employment in the United States. Such documentation must be
provided within 3 business days of the effective date of your employment, or
your employment relationship with the Company may be terminated.

      10. General. This offer letter, the Employee Proprietary Information
Agreement, the stock option agreement and related documents covering the grant
described in paragraph 3 above, and the Employee Handbook, when signed by you,
sets forth the terms of your employment with the Company and supersede any and
all prior representations and agreements, whether written or oral. This
agreement can only be amended in a writing signed by you and an officer of the
Company. Any waiver of a right under this agreement must be in writing. This
agreement will be governed by California law.

      We look forward to you joining the Company. If the foregoing terms are
agreeable, please indicate your acceptance by signing the enclosed copy of this
letter in the space provided below and returning it to me, along with your
completed and signed Employee Proprietary Information Agreement. This offer will
terminate if not accepted on or before May 7, 2001.

                                        Sincerely,

                                        XENOPORT, INC.

                                        By: /s/ Ronald W. Barrett
                                            ------------------------------------
                                            Ronald W. Barrett, Ph.D., President

AGREED AND ACCEPTED:

 /s/ William G. Harris                  May 7, 2001
----------------------                  -----------
William G. Harris                       Date

                                       3.