// if there was no node with such uuid in target workspace
return session.getNodeByIdentifier(uuid);
} else {
// otherwise get the latest child with such name
JcrNodeIterator iterator = parentNode.getNodes(name);
iterator.skip(iterator.getSize() - 1);
JcrNode newNode = iterator.nextNode();
String newUuid = newNode.getIdentifier();
// and if it has uuid other than the existing one (should always
// be the case)