Format HTTP links

Actually, the extension is irrelevant.

When your page is returned, WordPress is setting the content-type for the file in the headers as text/html; charset=UTF-8. This tells any consuming application that the content is HTML, not XML.

You need to force WordPress to send the appropriate headers when outputting the XML.

This content type is set by bloginfo('html_type') and is often copied into a <meta /> tag in your blog header as well. You can add a filter to hook in to this value:

add_filter( 'option_html_type', 'my_xml_override' );
function my_xml_override( $type ) {
    // First, check to make sure you're on the right page template:
    if ( /* On XML template */ ) {
        $type="text/xml";
    }

    return $type;
}

I leave detecting the page template as an excerise for you … mostly because I don’t have the time to test it for you. But if you look around, there are plenty of tutorials available.