preserve doc hierarchy