Thanks to Helmut, who made it possible, we can now automatically import personal pictures of tutors and students from the XML with the user data. The pictures are encoded using Base64 within the XML file, so there is no need to do anything more than this when creating the XML from a CSV file (or whatever):
$handle = fopen($tempfile,'rb');
$file_content = fread($handle,filesize($tempfile));
$encoded = chunk_split(base64_encode($file_content));
and then concatenate $encoded within the XML stream.
Importing a user file with 42 tutors (~150Kb, if the picture has ID card size), asigning different local roles, and creating 3 different size thumbnails (using imagemagick as backend), take a time of 20 seconds.