Treeview with pdf's and flv's

I have a problem with a tree-component.
I have an XML-file with names of pdf-files and flv-files.
I’m opening that file in a treeview-component. So long everything is fine.

How do I put different icons in the tree for the pdf’s and the flv’s?

If I click on a pdf in the tree, the right pdf-file should open up in a new window in my webbrowser. Any suggestions on that one?