Problems with creating hook that updates XML

The 1 character output error is probably because you have a single space before <?php or after ?>.

As far as it not doing anything, where is the fruits.xml file? this line:

$xml->load('fruits.xml');

in this context is looking for the file at:

/your/server/path/to/wp-admin/fruits.xml

Which I assume is not what you’re expecting. Have a look at Determining Plugin and Content Directories in Codex.