/// <summary>
        /// Calculates the structure of the document model.
        /// </summary>
        /// <param name="documentModel">Document model to recalculate</param>
        public void Restructure(IDocumentModelTree documentModel)
        {
            var context = new DocumentModelProcessContext()
            {
                DocumentModel   = (DocumentModelTree)documentModel,
                ElementPointers = new Dictionary <IElement, IDocumentObject>()
            };

            foreach (var element in ElementTree.NavigateAllElementsRecursively(context.DocumentModel.OwnerComponent))
            {
            }
            ProcessElementRecuresively(context, context.DocumentModel.OwnerComponent, null);
            context.DocumentModel.RootDocumentObject = context.ElementPointers[context.DocumentModel.OwnerComponent];
        }