i would just replcae $this->session... by $this->getNodeForDocument