Post processing of uploaded file

You can do this using the wp_handle_upload hook:

http://adambrown.info/p/wp_hooks/hook/wp_handle_upload?version=3.4&file=wp-admin/includes/file.php

Create a function and add it to this hook so it runs last, it will be passed an array. The array contains the location of the newly uploaded file:

add_filter('wp_handle_upload','wpse_66775_handle_upload',1000,1);
function wpse_66775_handle_upload($args){
    $filename = $args['file'];
    $type = $args['type'];
    // test if it's an XML file and do some work on it
    if(the file is an xml file){
        super_magic_xml_file_modifier($filename);
    }
    return $args;
}

function super_magic_xml_file_modifier($filename){
    // General PHP/XML stuff that doesn't belong on WPSE
}

Modifying the XML file etc, is another task that is not within the scope of this site.