Mobile agent systems are a powerful approach to develop distributed applications since they migrate to hosts on which they have the resources to execute individual tasks. Existing mobile agent systems require detailed knowledge about these hosts at the time of coding. This assumption is not acceptable in a dynamic environment like a peer-to-peer network, where hosts and, as a consequence, also agents become repeatedly connected and disconnected. To this end, we propose a predicatebased approach allowing the specification of hosts an agent has to migrate to. With this highly flexible approach, termed P2PMobileAgents, we combine the benefits of execution location transparency with those of code mobility. Similarly, also the recipients of messages can be specified by predicates, e.g. for synchronisation purposes. For providing meta information about agents and hosts we use XML documents.