Document:

EXHIBIT
      10.4

    

    FIRST
      AMENDMENT TO BUSINESS LOAN AGREEMENT

    

    THIS
      FIRST AMENDMENT TO BUSINESS LOAN AGREEMENT, dated
      as
      of November 13,
      2007
      (this
      “Amendment”), is between ADVANCED PHOTONIX, INC., a Delaware corporation (the
“Borrower”) and FIFTH THIRD BANK (the “Bank”).

    

    RECITAL

    

    The
      Borrower and the Bank are parties to a Business Loan Agreement dated as of
      March
      6, 2007 (the “Loan Agreement”). The Borrower and the Bank desire to amend the
      Loan Agreement on the terms set forth herein.

    

    TERMS

    

    In
      consideration of the premises and of the mutual agreements herein contained,
      the
      parties hereby agree as follows:

    

    ARTICLE
      I. AMENDMENTS
      TO LOAN AGREEMENT.

    

    The
      Loan
      Agreement shall be amended as follows:

    

    1.1 Section
      I
      shall be amended and restated in its entirety to read as follows:

    

    A. Revolving
      Line of Credit to the Borrower in aggregate principal amount up to THREE MILLION
      DOLLARS ($3,000,000) expiring July 1, 2008, upon the terms and conditions herein
      set forth. 

    

    1.2 Section
      5.1 shall be amended by deleting the reference therein to “TWO MILLION AND
      00/100 ($2,000,000)” and inserting “THREE MILLION AND 00/100 ($3,000,000)” in
      place thereof.

    

    1.3 Section
      7.1 shall be amended and restated in its entirety to read as
      follows:

    

    
      	
              7.1

            	
              Permit
                the Debt Service Coverage Ratio at the end of any fiscal quarter,
                to be
                less than 1.0 to 1.0, commencing with the fiscal quarter ending December
                31, 2007 and calculated (i) as of December 31, 2007 for such fiscal
                quarter, (ii) as of March 31, 2008 for such fiscal quarter, and (iii)
                with
                respect to each fiscal quarter thereafter, as of the last day of
                each
                fiscal quarter for the four consecutive fiscal quarters then
                ending.

            

    

    

    ARTICLE
      II. REPRESENTATIONS.
      The
      Borrower represents and warrants to the Bank that:

    

    2.1 The
      execution, delivery and performance of this Amendment and the new Note delivered
      pursuant to Article III are within its powers, have been duly authorized and
      are
      not in contravention with any law, or the terms of its articles of incorporation
      or organization, or by-laws or operating agreement, or any undertaking to which
      it is a party or by which it is bound.

    

    2.2 The
      Amendment is, and the new Note when executed and delivered will be, valid and
      binding in accordance with their respective terms.

     

    
      
        
        

      

      
        
        

        
          

        

      

      
        
        

      

    

     

    2.3 After
      giving effect to the amendments herein contained, the representations and
      warranties contained in the Loan Agreement and other Loan Documents are true
      on
      and as of the date hereof with the same force and effect as if made on and
      as of
      the date hereof and no event of default has occurred and is
      continuing.

    

    ARTICLE
      III. CONDITIONS PRECEDENT.

    

    This
      Amendment shall not become effective until each of the following conditions
      are
      satisfied:

    

    3.1 This
      Amendment shall be signed by the Borrower and the Bank and the Consent and
      Agreement at the end hereof shall be signed by each Guarantor.

    

    3.2 The
      Borrower shall have executed and delivered a new Revolving Credit Note to the
      Bank, in form and substance satisfactory to the Bank.

    

    3.3 The
      Borrower shall have delivered such other certificates or agreements reasonably
      requested by the Bank in connection herewith.

    

    ARTICLE
      IV. MISCELLANEOUS.

    

    4.1 Bank
      acknowledges and accepts an update to Schedule 5 to the Security Agreement
      referred to in Section 1.6 above in the form of Schedule 5 attached
      hereto.

    

    4.2 Except
      as
      expressly amended hereby, the Loan Agreement and all other Loan Documents shall
      remain in full force and effect and are ratified and confirmed by the Borrower.
      Terms used but not defined herein shall have the respective meanings ascribed
      thereto in the Loan Agreement.

    

    4.3 This
      Amendment may be signed upon any number of counterparts with the same effect
      as
      if the signatures thereto and hereto were upon the same instrument and
      telecopied signatures shall be enforceable as originals.

    
      
        
        

      

      
        
        

        
          

        

      

      
        
        

      

    

    IN
      WITNESS WHEREOF, the parties have caused this Amendment to be executed and
      delivered as of the day and year first above written.

    

    
      	 	
              ADVANCED
                PHOTONIX, INC.

            
	 	 	 
	 	
              By: 

            	
              /s/
                Robin F. Risser

            
	 	 	
               
                Its: CFO

            
	 	 	 
	 	
              FIFTH
                THIRD BANK

            
	 	 	 
	 	
              By: 

            	
              /s/
                Tonya R. Gietzen

            
	 	 	
               
                Its: Vice PresidentSEPARATION
      AGREEMENT

    

    THIS
      SEPARATION AGREEMENT
      ("Agreement") is made effective this 13 day of June, 2008, by and between XsunX,
      Inc., a Colorado Corporation (“XsunX”) and Sencera, LLC, a North Carolina
      Limited Liability Company (“Sencera”). XsunX and Sencera are herein referred to
      individually as a “Party” and collectively as the “Parties.”

    

    R E C I T A L S

    

    WHEREAS,
      effective on or about January 1, 2007, the Parties entered into a Technology
      Development and License Agreement (“Technology Agreement”) and a Loan Agreement
      (“Loan Agreement”) and Sencera executed a Promissory Note in favor of XsunX in
      the principal sum of $1,500,000.00 bearing interest at the rate of 10% per
      annum
      (“Note”) all pertaining to that certain project identified in the Technology
      Agreement (“Project);

    

    WHEREAS,
      certain
      disputes have arisen between the Parties in regard to the Project and the above
      agreements and instruments;

    

    WHEREAS,
      it is
      the intent of the Parties hereto, subject to the terms and conditions set forth
      in this Agreement, and upon payment of all principal and interest under the
      Note
      by Sencera to XsunX, to settle and release all claims between the Parties in
      regard to the Project and the above agreements and instruments.

    

    NOW,
      THEREFORE,
      in
      consideration of the mutual promises contained herein, and other good and
      valuable consideration, the sufficiency of which are hereby acknowledged, the
      Parties hereto agree as follows:

     

    ARTICLE
      1.

    

    TERMS
      OF SETTLEMENT

    

    1.1. Payment
      of Note.
      Sencera
      shall, in exchange for the mutual releases set forth herein below, and subject
      to the terms and conditions of this Agreement, pay to XsunX the sum of
$1,673,251.05
      representing
      the entire principal balance due under the Note plus interest
      accrued through June 6, 2008. The
      above
      amount shall be payable
      in full in cash or cash equivalent pursuant to immediately available funds
      ("Settlement Amount").

    

    1.2. Termination
      of Instruments.
      Upon
      receipt of the Settlement Amount in full in cash or cash equivalent pursuant
      to
      immediately available funds, the Technology Agreement, Loan Agreement, and
      Note
      shall be terminated and all obligations of the Parties thereunder shall be
      deemed fully performed and discharged and all sums shall be deemed paid under
      the Note and XsunX shall deliver to Sencera the original executed Note marked
      “Paid and Satisfied in Full” and signed by a duly authorized officer of XsunX;
      provided, however that the confidentiality provisions of sections 1.2 and 8
      of
      the Technology Agreement shall survive as contemplated in the Technology
      Agreement.

    

    
      
        
        

      

      
        
        

        
          

        

      

      
        
        

      

    

    1.3. Termination
      of Intellectual Property Rights.
      Upon
      receipt of the Settlement Amount in full in cash or cash equivalent pursuant
      to
      immediately available funds, all rights, if any, of XsunX in or to the
      intellectual property of Sencera under the Technology Agreement shall be
      terminated. Concurrently, and subject to the representations, terms and
      conditions of this Agreement, all rights, if any, of Sencera in or to the
      intellectual property of XsunX under the Technology Agreement shall be
      terminated. 

    

    1.4. Project.
      The
      Parties acknowledge that Sencera has provided to XsunX the written documents
      and
      reports in regard to the Project or otherwise under the Technology Agreement
      as
      listed in Exhibit “A” attached hereto and XsunX has provided to Sencera the
      written documents and reports in regard to the Project or otherwise under the
      Technology Agreement as listed in Exhibit “B” attached hereto. Each Party
      represents to the other Party that the representing Party has not intentionally
      misrepresented any material facts relating to the Project contained in the
      written documents and reports provided by the representing Party. Neither Party
      accepts or admits the truthfulness or accuracy of the assertions made in the
      documents listed in the other Party’s Exhibit. XsunX acknowledges that Sencera
      has disclosed to XsunX that pages 9 and 10 of Report 1 dated February 6, 2007
      sent by Sencera to XsunX contain conflicting information of chamber cost
      estimates and Sencera has disclosed to XsunX that this was not intentional
      and
      that Sencera thinks the estimates on page 10 are more accurate. XsunX further
      acknowledges that Sencera has stated to XsunX that Sencera has produced a
      licensed process to satisfy Phase II of the Technology Agreement notwithstanding
      a prior letter by Sencera that was inconsistent with this representation. XsunX
      agrees that neither of these discrepancies shall be a basis for a breach of
      this
      Agreement or for a claim that the other provisions of this Agreement are not
      effective. Sencera acknowledges that XsunX is not agreeing hereby that Sencera
      has produced a licensed process to satisfy Phase II. Each Party further
      represents to the other Party that the representing Party has had the
      opportunity to conduct, and has conducted, such investigations and due diligence
      relating to the other Party and the Project as the representing Party deems
      appropriate prior to entering into this Agreement. The Parties agree that the
      documents listed in Exhibits “A” and “B” are confidential information under
      Sections 1.2 and 8 of the Technology Agreement and are subject to the terms
      thereof which survive the execution of this Agreement and the termination of
      the
      remainder of the Technology Agreement. The
      Parties expressly acknowledge that disclosure is required by XsunX under the
      Securities Exchange Act of 1934 (the “Act”), Generally Accepted Accounting
      Principals ("GAAP"), the U.S. Securities and Exchange Commission ("SEC")
      accounting rules requiring certain accounting or footnote disclosures, and
      SEC
      rules and regulations governing Form 8-K and Form 10-K under the Act, and that
      subject to the above rules and regulations the material contents of this
      Agreement as it relates to the disclosure requirements may be announced and
      filed with the SEC by XsunX without opportunity for
      Sencera
      to
      oppose such filing or reporting.  XsunX does not anticipate the disclosure
      by it of the contents of the documents listed in Exhibit “A” and will only
      disclose the contents of the documents listed in Exhibit “A” if required to do
      so under applicable law, rule, or regulation or by
      a
      valid and enforceable order issued by a court or agency, including the SEC,
      of
      competent jurisdiction. XsunX will use reasonable commercial efforts to
      provide advanced written notice to Sencera if XsunX is required by the SEC
      to
      disclose the contents of any of the documents listed in
      Exhibit “A.” While XsunX shall file said documents if so required by the SEC, it
      will include a request for confidential treatment of said documents with any
      such filing. 

     

    
      
        
        

      

      
        2

        
          

        

      

      
        
        

      

    

    1.5. Mutual
      General Release.
      Upon
      the full payment of the Settlement Amount by Sencera to XsunX as aforementioned,
      XsunX on the one hand and Sencera on the other hand, on behalf of such Party
      and
      the agents, servants, employees, representatives, successors, assigns, officers,
      directors, members, managers, parents, subsidiaries, and affiliates of such
      Party, shall, and hereby do, fully release and discharge the other Party, and
      the agents, servants, employees, representatives, successors, assigns, officers,
      directors, members, managers, parents, subsidiaries, and affiliates of such
      other Party, from all rights, claims, liabilities, actions, causes of action,
      and damages, which the one Party has or may have against the other Party with
      respect to the matters set forth in or related to the Technology Agreement,
      Loan
      Agreement, and Note, whether known or unknown.

    

    1.6. Waiver
      of Civil Code Section 1542.
      Each of
      the Parties hereto knowingly and expressly waive the provisions of California
      Civil Code Section 1542 pertaining to General Releases. California Civil Code
      Section 1542 provides:

    

    "A
      general release does not extend to claims which the creditor does not know
      or
      suspect to exist in his favor at the time of executing the release, which if
      known by him must have materially affected his settlement with the
      debtor."

    

    1.7. No
      Admission of Liability.
      This
      Agreement is not an admission of liability by any of the Parties hereto for
      any
      purpose. The settlement set forth herein is of a contested matter and by
      settling, no Party admits any liability in regard to any matter whatsoever.
      

    

    1.8. Advice
      of Counsel.
      This
      Agreement is freely and voluntarily entered into and executed by the Parties,
      each of the Parties hereto being duly represented by counsel. Each of the
      Parties have been advised of and understands the terms and conditions of this
      Agreement.

    

    1.9. Authority
      to Execute Agreement.
      Each
      Party hereto represents and warrants that any individual executing this
      Agreement on behalf of a corporate or limited liability company entity has
      the
      requisite power and authority to so execute this Agreement on behalf of the
      corporation or limited liability company and bind any corporate or limited
      liability company entity purported to be a Party hereto to the obligations
      and
      duties set forth herein.

    

    1.10. Warranties
      of All Parties.
      Each
      Party hereto represents and warrants that such Party has not assigned, sold
      or
      transferred, nor purported to have assigned, sold or transferred, any rights,
      claims or actions herein released, including any rights, claims or actions
      pertaining to the subject matter of this Agreement.

    

    1.11. Non-Solicitation.
      Each
      Party acknowledges that all information pertaining to the officers and employees
      of the other Party (“Employing/Engaging Party”) shall be deemed to constitute
      confidential information hereunder and under the confidentiality provisions
      of
      section 8 of the Technology Agreement. Neither Party (nor their directors,
      officers, employees, members, managers, parents, subsidiaries, or affiliates)
      shall, directly or indirectly, solicit, employ, engage or otherwise obtain
      the
      services of any of the officers or employees of the other Employing/Engaging
      Party for a period of two (2) years from the date of this Agreement without
      the
      prior written consent of the other Employing/Engaging Party.

    

    
      
        
        

      

      
        3

        
          

        

      

      
        
        

      

    

    

    ARTICLE
      2.

    

    MISCELLANEOUS

    2.1 Recitals.
      The
      recitals set forth above are incorporated herein by this reference and made
      a
      part of this Agreement.

    

    2.2 Expenses.
      Each of
      the Parties shall pay all costs and expenses incurred or to be incurred by
      it in
      negotiation and preparing this Agreement, and in closing and carrying out the
      transactions contemplated herein.

    

    2.3. Effect
      of Headings.
      The
      subject headings of the paragraphs and subparagraphs of this Agreement are
      included for purposes of convenience only, and shall not affect the construction
      or interpretation of any of its provisions.

    

    2.4. Entire
      Agreement; Modification; Waiver.
      This
      Agreement constitutes the entire agreement between the Parties hereto pertaining
      to the subject matter contained in it and supersedes all prior and
      contemporaneous agreements, representations and understandings of the Parties.
      No waiver of any of the provisions of this Agreement shall be deemed, or shall
      constitute a waiver of any other provision, whether or not similar, nor shall
      any waiver constitute a continuing waiver. No waiver shall be binding unless
      executed in writing by the Party making the waiver.

    

    2.5. Severability.
      Should
      any provision or portion of this Agreement be held or otherwise become
      unenforceable or invalid for any reason, the remaining provisions and portions
      of this Agreement shall be unaffected by such unenforceability or
      invalidity.

    

    2.6. Parties
      in Interest.
      Nothing
      in this Agreement, whether express or implied, is intended to confer any rights
      or remedies under or by reason of this Agreement on any person other than the
      Parties to it and their respective successors and assigns, nor is anything
      in
      this Agreement intended to relieve or discharge the obligation or liability
      of
      any third persons to any Party to this Agreement, nor shall any provision give
      any third person any right of subrogation or action over against any Party
      to
      this Agreement.

    

    2.7. Assignment.
      This
      Agreement shall be binding on, and shall inure to the benefit of the Parties
      to
      it and their respective heirs, legal representatives, successors and
      assigns.

    

    2.8. Specific
      Performance.
      Each
      Party's obligations under this Agreement are unique. If any Party should default
      in its obligations under the terms of this Agreement, the Parties each
      acknowledge that it would be extremely impracticable to measure the resulting
      damages; accordingly, the nondefaulting Party, in addition to any other
      available rights or remedies, may sue in equity for specific performance, and
      the Parties hereto each expressly waive the defense that a remedy in damages
      will be adequate.

    

    
      
        
        

      

      
        4

        
          

        

      

      
        
        

      

    

    2.9. Recovery
      of Litigation Costs.
      If any
      legal action, arbitration or other proceeding is brought for the enforcement
      of
      this Agreement, or because of an alleged dispute, breach, default or
      misrepresentation in connection with any of the provisions of this Agreement,
      the successful or prevailing Party or Parties shall be entitled to recover
      as an
      element of their damages reasonable attorney's fees and other costs incurred
      in
      that action or proceeding, in addition to any other relief to which said
      prevailing Party may be entitled.

    

    IN
      WITNESS WHEREOF,
      the
      Parties to this Settlement Agreement have duly executed it to be effective
      as of
      the day first written above.

     

    

    
      	 	
              XsunX:

            
	 	 
	 	
              XsunX,
                Inc., a Colorado Corporation

            
	 	 
	 	 
	
              Dated:

            	
              By:
                _____________________________________

            
	
              June
                13, 2008

            	
                    
                Tom Djokovich, CEO 

            
	 	 
	 	 
	 	
              Sencera:

            
	 	 
	 	
              Sencera,
                LLC, a North Carolina Limited Liability

            
	 	
              Company

            
	 	 
	 	 
	
              Dated:

            	
              By:
                ____________________________________

            
	
              June
                13, 2008

            	
                    
                Dr. Rusty Jewett, Manager

            

    

    

    
      
        
        

      

      
        5

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00143-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00143-of-00352.parquet"}]]