PEAR contains an XML_Serializer and XML_Unserializer class. These classes allow you to convert an aribritrary PHP datastructure to XML and back. As PHP is dynamically typed this XML has to contain type (classes) information.
These days, XML has become part of landscape in most all areas of software development — none more so than on the Web. Those using common XML applications, such as RSS and XML-RPC, will probably find public domain libraries geared specifically to help them work with the formats, eliminating the need for wheel re-invention.