A better idiom here is `let parent = match base.node.parent_node() { None => base.node, Some(parent) => parent, }`. We should minimize use of `mut`.