How to get xml file for a single post type?

Typically when you want to create an extra representation or variation it implies extending URL a bit and treating that case differently.

The easiest way in WP for that are rewrite endpoints.

However the ease is relative you still need to handle with code the changes in a query and how to produce output. WP doesn’t have an easy native concept of multiple representations of content so there aren’t really turn-key solutions for that.