I've extended cl-prevalence slightly to support some custom serialization and deserialization of user data types. The attached diff contains a patch that allows users to hook into the serialization protocol at the appropriate places.
Here is an example of how to hook into the protocol. The last two functions (of 3) were added in the diff.
;; Serializer support for persistent objects
(defmethod s-serialization::serialize-xml-internal ((object persistent) stream serialization-state) (declare (ignore serialization-state)) (write-string "<PERSISTENT ID="" stream) (prin1 (oid object) stream) (write-string ""/>" stream))
(defmethod s-serialization::deserialize-xml-new-element-aux ((name (eql :persistent)) attributes) (elephant::controller-recreate-instance *store-controller* (parse-integer (s-serialization::get-attribute-value :id attributes))))
;; Not needed in this app: ;; (defgeneric deserialize-xml-finish-element-aux ((name (eql :persistent)) attributes parent-seed seed) ;; seed)
Regards, Ian