Building document structures