private Node processNodeSource( final VirtualFile nodeFolder, final ProcessNodeSettings.Builder processNodeSettings) { final VirtualFile nodeSource = this.exportReader.getNodeSource(nodeFolder); final Node.Builder newNodeBuilder = Node.create(); try { final XmlNodeParser parser = new XmlNodeParser(); parser.builder(newNodeBuilder); parser.source(nodeSource.getCharSource()); parser.parse(); } catch (final Exception e) { throw new XmlException(e, "Could not load source node [" + nodeSource.getUrl() + "]: ", e); } final Node newNode = newNodeBuilder.build(); final NodePath importNodePath = NodeImportPathResolver.resolveNodeImportPath(nodeFolder, this.exportRoot, this.importRoot); final boolean isNodeExisting = this.nodeService.getByPath(importNodePath) != null; final Node importedNode = importNode(nodeFolder, processNodeSettings, newNode, importNodePath); if (isNodeExisting) { result.updated(importedNode.path()); } else { result.added(importedNode.path()); } return importedNode; }