Improved $obj->path method, to optionally allow the root element to be described in the parameter as well