Input: TPST , TPST , mapped node set: , mapped fragment set:
Output: The edit script: editScript
EditScript ;
for each node of in level-order do
 let be the current node;
if is not belong to then
  add Del to editScript;
end
end
for each node of in level-order do
 let be the current node;
if is not belong to then
   add Insert to editScript;
end
end
for each fragment pair of do
.root.parent;
.root.parent;
if is not belong to then
   add Move to editScript;
end
end
return editScript;
Algorithm 6: EditScript_Generation.