I need a standalone script in web root but still have access to the database

You could do that, including wp-load.php would bootstrap WordPress and allow you to query the database. I prefer to keep things encapsulated in plugins though, much more portable. You just need to hook early enough to send your own headers, and you can short-circuit the rest of the load process. For example-

function wpd_my_export_script() {
    if( isset( $_GET['do_my_export_stuff'] ) ) {
        header('Content-Type: application/xml; charset=utf-8');
        // do your database stuff
        exit;
    }
}
add_action( 'wp_loaded', 'wpd_my_export_script' );

Then visiting http://example.com/?do_my_export_stuff will trigger your code.