This paper aims to explore the potential role of XML in wireless sensor networks by developing a communication protocol based on this language. This is done by means of two devices with wireless communication capabilities equipped with temperature sensors, light, Hall effect and level of battery charge. The sensor device software is written in nesC language within the TinyOS operating system. The data mining has been developed under a Microsoft .NET platform.