We characterize publication and retrieval of structured documents in peer-to-peer (P2P) file-sharing systems, based on the abstract notion of community, emcompassing a shared document schema, a network protocol and data presentation tools. We present an extension of this model to manage multiple communities, and to describe relations between documents or communities. Our approach is based on the idea of reifying complex concepts to structured documents, then sharing these documents in the P2P network. The design of our prototype P2P client involves components interacting asynchronously using the blackboard model. This decoupled architecture allows the system to dynamically extend its query processing functionality by creating new components that implement the processing described in downloaded documents.