Added a function to add a UUID to the Atom XML; some miscellaneous code cleanup.