code: private ItemData updatePath(QPath parentOld, QPath parent, ItemData oldItemData) throws IllegalPathException
     {
        int relativeDegree = oldItemData.getQPath().getDepth() - parentOld.getDepth();
        QPath newQPath = QPath.makeChildPath(parent, oldItemData.getQPath().getRelPath(relativeDegree));
  
        ItemData newItemData;
        if (oldItemData.isNode())
        {
           NodeData oldNodeData = (NodeData)oldItemData;
           newItemData =
              new TransientNodeData(newQPath, oldNodeData.getIdentifier(), oldNodeData.getPersistedVersion(),
                 oldNodeData.getPrimaryTypeName(), oldNodeData.getMixinTypeNames(), oldNodeData.getOrderNumber(),
                 oldNodeData.getParentIdentifier(), oldNodeData.getACL());
        }
        else
        {
           PropertyData oldPropertyData = (PropertyData)oldItemData;
           newItemData =
              new TransientPropertyData(newQPath, oldPropertyData.getIdentifier(),
                 oldPropertyData.getPersistedVersion(), oldPropertyData.getType(),
                 oldPropertyData.getParentIdentifier(), oldPropertyData.isMultiValued(), oldPropertyData.getValues());
        }
        return newItemData;
     }
docs: Updates the path of the item data and gives the updated objects
  @param parentOld the path of the old ancestor
  @param parent the path of the new ancestor
  @param oldItemData the old item data
  @return the {@link ItemData} with the updated path
  @throws IllegalPathException if the relative path could not be retrieved