You can't stop the right click action in a plain XML file. On some browsers, you can prevent the right click action in an HTML file, because an HTML file is allowed to run javascript, which is allowed to intercept the right click ( as you've surely discovered ). If you're displaying plain XML, you can't usually run javascript in the same frame.
However, if you don't mind learning XSLT, you can add a client-side XSL transform directive to the plain XML file, and have the transformation add javascript and alternate HTML rendering to the plain XML. In that way, you can get Javascript in the same frame as the XML. So in a given browser ( one that supports oncontextmenu ), you can stop the user getting a right-click menu in an XML file; if you don't mind learning/doing what I just suggested. ( Not all browsers support client side XSL, although IE6+ and Firefox 2+ certainly do ). Depending on how you want the XML displayed, that may not be appropriate.
You can't stop View Source, regardless! Even if you hide the toolbar of a frame using a popup/inner frame and successfully manage to disable right-click, there could be a hotkey bound to View Source, and blocking right-click only ever works with JS enabled, and on certain browsers. ( The Opera browser for e.g. makes it very easy to selectively ignore one page's Javascript temporarily, so it's not like a user has to go to any trouble to contravene any measure you may put in-place ).
The goodness of your intentions is wholly irrelevant, as is the class of your application. You're working with browsers, and browers quite reasonably limit what you're allowed to do through them.
If it only works in Internet Explorer; it doesn't work.