/** * Useful -for example- for building xPath strings * * @param string $separator * @return string */ public final function getPathWithSeparator($separator = '/') { if ($this->parent) { return $this->parent->getPathWithSeparator($separator) . $separator . $this->getName(); } else { return $separator . $this->getName(); } }