Here's an article I wrote today on how to write a package file editor (like the package editor that comes with xcess).
The article can be found here:

http://hosted.xcessred.com/articles/packageditor.htm