This Item Template lets you add a XSLT webpart to your SharePoint solution. It contains some sample code that's pretty much self explaining. Your task is:
Edit the provided sample code so that it spits out your custom xml.
Edit the provided XSLT file so that it can translate your custom XML the way you want.
If needed edit the provided CSS so that your final output looks pretty!
SMILE!!!
Your XSLT/CSS files will be provisioned in the style library, providing your customer the flexibility to change the generated HTML long after you deployed your solution.
Why we must use it?
The main goal here is to separate code logic and presentation. We can do this by first generate some xml code (as seen in the sample .cs file). Secondly we will translate this xml code into html using XSLT (as seen in the sample .xslt file) A major benefit of using this template is that the sample .xslt file (read: the way your webpart is presented to the end user) can be edited by your site admins (or anybody who has access to the site's style library). This way if someone decides that the layout of some webpart needs to be changed, probably a long time after you have delivered you're code release, they can do this themselves (a little knowledge of xslt is required though).
How to use:
Install this Extension
Create or open a SharePoint 2010 Project
Add -> New Item (Crtr + Shift + A)
Choose "Visual C#" from the Item Templates categories
Choose "XSLT WebPart"
Click Add
When you deploy of debug (F5) your solution it will automatically add webpart file to your webpart gallery. Manually add this webpart to your page, it can be found in the custom Webparts group. If all went well, you will see a new (sample) menu is added to your page. Now you can get creative and customize the sample code the way you want it.