traverse a domdocument in a post-order way