Accept only one conent type in file

Is there a way to let the form - file only accept a xml file extension?

You need to check the extention of realName parameter in onBeforeFileAdd event and return false if it is not .xml

I mean the select box in the file add window.
You have optins * all files, image files, html files.
But in that select box I only want to display .xml in that box.

I was already able to check for the extension.

So, in this case unfortunately not.

You can do cancelation only through the event. Browser will not allow you to do that. In theory it can work on Flash. But not everywhere.