The new XSLT List View Web Part (XLV Web Part) in SharePoint 2010 allows a new level of SharePoint customization and allows us to create custom webparts in an easier way. I hope this post guides you if you would like to create a custom xsl definition for a specific list.
1) Add the following xsl file in the TEMPLATE/LAYOUTS/XSL folder and name it xml.xsl.
This will make the xsl available on each sharepoint site by using /_layouts/xsl/xml.xsl
Download the xsl file here:
2) Add a new list view webpart and open the webpart properties screen. Under the category miscellaneous there is a textbox where you can provide a new xsl file reference. Provide the link to /_layouts/xsl/xml/xsl
3) The transformation will (html) encode the source xml and display the result in the browser, copy the xml and store it in your solution as listdata.xml. We will use this xml file to debug our custom xsl definition.
4) Add a new xsl file into the visual studio solution. Copy Paste the following example in the xsl file, it will visualize a collection of divs where each div contains the title value of each row.
6) Visual studio will ask you where it can find the source xml, this is the raison why we created the listdata.xml in our current solution and create a new xml file where the result will be stored in. This result file will contain the html code that will be displayed in the list view webpart.
Hope it helps,