Made encoding an arg, for appendXMLFile(), previously hardcoded utf-8