Enhanced the appendXML function so that it doesn't have to read the entire xml. Fixed error where the edited xml may have spaces at the end.