code: public BaseXmlExporter getExportVisitor(XmlMapping type, OutputStream stream, boolean skipBinary, boolean noRecurse,
        boolean exportChildVersionHistory, ItemDataConsumer dataManager, NamespaceRegistry namespaceRegistry,
        ValueFactoryImpl systemValueFactory) throws NamespaceException, RepositoryException, IOException
     {
  
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter streamWriter;
        try
        {
           streamWriter = outputFactory.createXMLStreamWriter(stream, Constants.DEFAULT_ENCODING);
        }
        catch (XMLStreamException e)
        {
           throw new IOException(e.getLocalizedMessage(), e);
        }
  
        if (type == XmlMapping.SYSVIEW)
        {
           return new SystemViewStreamExporter(streamWriter, dataManager, namespaceRegistry, systemValueFactory,
              skipBinary, noRecurse, exportChildVersionHistory);
        }
        else if (type == XmlMapping.DOCVIEW)
        {
           return new DocumentViewStreamExporter(streamWriter, dataManager, namespaceRegistry, systemValueFactory,
              skipBinary, noRecurse);
  
        }
        else if (type == XmlMapping.BACKUP)
        {
           return new WorkspaceSystemViewStreamExporter(streamWriter, dataManager, namespaceRegistry, systemValueFactory,
              skipBinary, noRecurse);
        }
        return null;
     }
docs: Create export visitor for given type of view.\
  
  @param type - 6.4 XML Mappings
  @param stream - output result stream
  @param skipBinary- If skipBinary is true then any properties of
  PropertyType.BINARY will be serialized as if they are empty.
  @param noRecurse- if noRecurse is false, the whole subtree are serialized
  @param exportChildVersionHistory - does versioned child nodes version history must be exported
  (works ONLY with system view).
  @param dataManager - ItemDataConsumer
  @param namespaceRegistry - NamespaceRegistry
  @param systemValueFactory - default value factory
  @return - visitor BaseXmlExporter.
  @throws NamespaceException
  @throws RepositoryException
  @throws IOException