Rearrange document