code: protected NodeData getCorrespondingNodeData(SessionImpl corrSession) throws ItemNotFoundException,
        AccessDeniedException, RepositoryException
     {
        final QPath myPath = nodeData().getQPath();
        final SessionDataManager corrDataManager = corrSession.getTransientNodesManager();
  
        if (this.isNodeType(Constants.MIX_REFERENCEABLE))
        {
           NodeData corrNode = (NodeData)corrDataManager.getItemData(getUUID());
           if (corrNode != null)
           {
              return corrNode;
           }
        }
        else
        {
           NodeData ancestor = (NodeData)dataManager.getItemData(Constants.ROOT_UUID);
           for (int i = 1; i < myPath.getDepth(); i++)
           {
              ancestor = (NodeData)dataManager.getItemData(ancestor, myPath.getEntries()[i], ItemType.NODE);
              if (corrSession.getWorkspace().getNodeTypesHolder().isNodeType(Constants.MIX_REFERENCEABLE,
                 ancestor.getPrimaryTypeName(), ancestor.getMixinTypeNames()))
              {
                 NodeData corrAncestor = (NodeData)corrDataManager.getItemData(ancestor.getIdentifier());
                 if (corrAncestor == null)
                 {
                    throw new ItemNotFoundException("No corresponding path for ancestor "
                       + ancestor.getQPath().getAsString() + " in " + corrSession.getWorkspace().getName());
                 }
  
                 NodeData corrNode =
                    (NodeData)corrDataManager.getItemData(corrAncestor, myPath.getRelPath(myPath.getDepth() - i),
                       ItemType.NODE);
                 if (corrNode != null)
                 {
                    return corrNode;
                 }
              }
           }
        }
        NodeData corrNode = (NodeData)corrDataManager.getItemData(myPath);
        if (corrNode != null)
        {
           return corrNode;
        }
  
        throw new ItemNotFoundException("No corresponding path for " + getPath() + " in "
           + corrSession.getWorkspace().getName());
     }
docs: Return Node corresponding to this Node.
  
  @param corrSession
  session on corresponding Workspace
  @return NodeData corresponding Node
  @throws ItemNotFoundException
  if corresponding Node not found
  @throws AccessDeniedException
  if read impossible due to permisions
  @throws RepositoryException
  if any other error occurs