You should take a look at the Sitecore.Install.PackageGenerator
class in the Sitecore.Kernel to see how you may go about creating traditional Sitecore packages.
However, you are looking to do this outside of a website context. How do you plan on getting items into the package if you don't have access to the Sitecore web site in which they exist? Before you try to create a package on your CI server I would think you would need to get the Sitecore items into source control so that you can work with them.
I think you have two real options here.
- Roll your own solution, leveraging serialization APIs, for getting Sitecore items into source control and moving between environments
- Hedgehog Development's Team Development for Sitecore
For more information on Sitecore serialization please check out the Sitecore Serialization Guide. Specifically, check out how Sitecore envisions you use "Sitecore Serialization with a Source Control System"
Also, do some digging around for others who have rolled their own solution around serialization. For instance, http://mcore.wordpress.com/2009/03/17/sitecore-serialization-for-version-control/