MobiDoc is a framework for building mobile compound documents, where the compound document can be dynamically composed of mobile agents and can migrate itself over a network as a whole, with all its embedded agents. The key of this framework is that it builds a hierarchical mobile agent system that enables multiple mobile agents to be combined into a single mobile agent. The framework also provides several added-value mechanisms for visually manipulating components embedded in a compound document and for sharing a window on the screen among the components. This paper will describe the MobiDoc framework and its first implementation, currently using Java as implementation language as well as component development language, and then illustrate several interesting applications to demonstrate the utility and flexibility of this framework.