code: @Override
     protected void leaving(NodeData node, int level) throws RepositoryException
     {
        try
        {
           if (exportChildVersionHistory && node.getPrimaryTypeName().equals(Constants.NT_VERSIONEDCHILD))
           {
              try
              {
                 PropertyData childVersionHistory =
                    ((PropertyData)dataManager.getItemData(node, new QPathEntry(Constants.JCR_CHILDVERSIONHISTORY, 1),
                       ItemType.PROPERTY));
                 String childVersionHistoryId =
                    getValueAsStringForExport(childVersionHistory.getValues().get(0), childVersionHistory.getType());
  
                 //check does this child version history was already exported
                 if (!exportedVersionHistories.contains(childVersionHistoryId))
                 {
  
                    writer.writeStartElement(Constants.NS_SV_PREFIX, Constants.SV_VERSION_HISTORY, getSvNamespaceUri());
                    writer.writeAttribute(Constants.NS_SV_PREFIX, getSvNamespaceUri(), Constants.SV_NAME,
                       childVersionHistoryId);
  
                    NodeData versionStorage = (NodeData)dataManager.getItemData(Constants.VERSIONSTORAGE_UUID);
                    NodeData childVersionNodeData =
                       (NodeData)dataManager.getItemData(versionStorage, new QPathEntry("", childVersionHistoryId, 1),
                          ItemType.NODE);
                    childVersionNodeData.accept(this);
  
                    writer.writeEndElement();
                    exportedVersionHistories.add(childVersionHistoryId);
                 }
              }
              catch (IOException e)
              {
                 throw new RepositoryException("Can't export versioned child version history: " + e.getMessage(), e);
              }
           }
  
           writer.writeEndElement();
        }
        catch (XMLStreamException e)
        {
           throw new RepositoryException(e);
        }
  
     }
docs: /*
  (non-Javadoc)
  @see
  org.exoplatform.services.jcr.dataflow.ItemDataTraversingVisitor#leaving(org.exoplatform.services
  .jcr.datamodel.NodeData, int)