Make walk more flexible by allowing the caller to pass in the node type. Add a test for the walk methods on Document.