while ((currentElement != lastElement))
{
    currentIndex = currentParagraph.Inlines.IndexOf(currentElement);
    {

        currentElement.Paragraph.Inlines.Remove(currentElement);
        if (currentParagraph.Inlines.Count == 0)
        {

            var currentSection = currentParagraph.Parent as Section;
            var nextParagraphIndex = currentSection.Blocks.IndexOf(currentParagraph);
            currentSection.Blocks.Remove(currentParagraph);
            currentParagraph = currentSection.Blocks[nextParagraphIndex] as Paragraph;

            while (currentParagraph == null || currentParagraph.Inlines.Count == 0)
            {
                currentSection.Blocks.Remove(currentParagraph);
                currentParagraph = currentSection.Blocks[nextParagraphIndex] as Paragraph;

                if (currentParagraph == null)
                {
                    // The Block element being currently iterated through is a Table
                    currentSection.Blocks.Remove(currentSection.Blocks[nextParagraphIndex]);
                }
            }

            currentElement = currentParagraph.Inlines.First();
            currentIndex = 0;
            continue;
        }
    }

    if (currentIndex < currentParagraph.Inlines.Count)
    {
        currentElement = currentParagraph.Inlines[currentIndex];
    }
    else
    {
        var currentSection = currentParagraph.Parent as Section;
        currentParagraph = currentSection.Blocks[currentSection.Blocks.IndexOf(currentParagraph) + 1] as Paragraph;

        while (currentParagraph == null || currentParagraph.Inlines.Count == 0)
        {
            currentParagraph = currentSection.Blocks[currentSection.Blocks.IndexOf(currentParagraph) + 1] as Paragraph;
        }

        currentElement = currentParagraph.Inlines.First();
    }
}