Optimize document tree (STED format)