XML exporting revised n some fixes