The Horde_Serialize library provides various methods of encapsulating data.

WWW: http://pear.horde.org
