fully implemented XML stuff