Read document structure dynamically to be able to react on structural changes.