Motte,
It looks like you want to append new sections to the file and XML::Writer thinks you want to write a whole new XML doc at the end of the file.
I see three ways around the problem:
1. Read the xml file into a hash, add you data to the hash and write the entire hash out as an xml file...