Finalized XML reading and writing