Though it's an XML file, it's most likely a file that's being parsed by a server-side language (through either a handler, .htaccess assignment (e.g. AddType application/x-httpd-php .xml), or otherwise)
As long as the server knows that a file of type XML (in this case) needs to go through the parser, any server-side language (such as PHP, ASP) can then handle the file and output a valid XMl document (using query strings) and it appear as though it was a normal file.
A great example of this are .rss files. They are dynamic content that have a classic extension, but something server-side is rendering the information as it becomes available.
Case in point. Suppose you're running PHP on your server. You have a directory called "feeds" (/public_html/feeds/) which contains an XML feed. Within that directory, you create a file called .htaccess and tell apache it needs to send the .XML extension to the PHP processing engine:
AddType application/x-httpd-php .xml
Then, in that same directory you have stories.xml which generates a list of content based on database information and every query always renders the latest information from the server. This file could look something like the following:
<?php
// this tells the client what kind of document this is
header('Content-Type: application/xml');
// pseudo database connection
include_once('db.php');
// setup the header:
echo '<?xml version="1.0" encoding="utf-8"><stories>';
// pseudo story-gatherer
$stories = Stories::Fetch($_GET['filter_by']); // use of a GET variable
foreach ($stories as $story){
echo '<story>'
.'<author>'.$story['author'].'</author>'
.'<title>'.$story['title'].'</title>'
.'<date>'.$story['date'].'</date>'
.'</story>';
}
// close the file
echo '</stories>';
?>
And now you have a file that ends in .XML and is filtered by a GET variable (Accessible via http://mysite.com/feeds/stories.xml?filter_by=Brad+Christie). To the user, it would only look something like this:
<?xml version="1.0" encoding="utf-8">
<stories>
<story>
<author>Brad Christie</author>
<title>Making .XML render dynamic content</title>
<date>2011-02-10 12:52:00</date>
</story>
</stories>
Very primitive example, but just showing concepts not proper coding style. ;-)
http://site.com/file.xmlisn't any kind of file, it's a URL.