I am writing a code which does a restore of site collection programatically. I am using Site Deleting Event handler. I need to take backup of individual Site, not the Site Collection. How should i do it?
The SharePoint Site Recycle Bin functionality that is a part of the Microsoft SharePoint Governance and Manageability project on codeplex does something similar to what you want.
The SharePoint Site Recycle Bin is a SharePoint Foundation 2010 solution package that when deployed to a Microsoft SharePoint Foundation 2010 or Microsoft SharePoint Server 2010 server farm enables administrators to create a snapshot of subscriptions, site collections and Webs as they are deleted through the SharePoint user interface, the SharePoint Administration Tool, the SharePoint 2010 Management Shell, SharePoint 2010 Central Administration, or SharePoint Designer.
There is a version for SharePoint 2007 as well.
I believe you can get the equivalent of an stsadm -o export out of the Content Deployment API. Check out the MSDN page.