public function restoreItem($removeExisting, $versionPath, $path)
{
$path = $this->encodeAndValidatePathForDavex($path);
$body = '<D:update xmlns:D="DAV:">
<D:version>
<D:href>' . $this->addWorkspacePathToUri($versionPath) . '</D:href>
</D:version>
';
if ($removeExisting) {
$body .= '<dcr:removeexisting xmlns:dcr="http://www.day.com/jcr/webdav/1.0" />';
}
$body .= '</D:update>';
$request = $this->getRequest(Request::UPDATE, $path);
$request->setBody($body);
$request->execute();
// errors are checked in request
}