The mediator-wrapper approach to integrate data from heterogeneous data sources has usually been centralized in the sense that a single mediator system is placed between a number of data sources and applications. As the number of data sources increases, the centralized mediator architecture becomes an administrative and performance bottleneck. This paper presents a query decomposition algorithm for a distributed mediation architecture where the communication among the mediators is on a higher level than the communication between a mediator and a data source. Some of the salient features of the proposed approach are: (i) exploring query execution schedules that contain data flow to the sources, necessary when integrating object-oriented sources that provide services (programs) and not only data; (ii) handling of functions with multiple implementations at more than one mediator or source; (iii) multi-phase query decomposition using a combination of heuristics and cost-based strategies; (iv) query plan tree rebalancing by distributed query recompilation.