Updating document structure