corrected some errors, xml functionality is still faulty