Traditional lab automation systems are highly centralized: dispatch and coordination of activities are mediated by a system controller, usually via a single, monolithic control procedure. This approach, while conceptually simple, makes changes to the system difficult; adding or removing instruments and functionality can be a daunting task. In addition, most automated systems are tied to particular development languages and protocols, making operation in heterogeneous environments (i.e., the real world) problematic, since instrument software comes in many different implementations. We present a peer-to-peer architecture for lab automation, using an XML-based communication protocol. The architecture consists of peer instrument servers, an XML communication layer, and an open control center. Each instrument peer can control, be controlled by, and communicate information to other instrument peers to fulfill the automation task. Our protocol is based on XML-RPC, a lightweight communication standard built atop HTTP. This provides an open and flexible means of peer-to-peer interfacing. The control center serves as a convenient, Web-based interface to manage the instruments. The automated procedure can be distributed across all available instrument peers (each instrument assigned a set of responsibilities); the controller implements a limited set of high-level instructions. The software components included in our prototype system are implemented in various programming languages, including Java, C/C++, Visual Basic, and LabVIEW. Our approach facilitates rapid development of laboratory automation systems.