public function import(\XMLReader $xmlReader, $targetPath, $resourceLoadPath = null)
    {
        $this->propertyMappingConfiguration = new ImportExportPropertyMappingConfiguration($resourceLoadPath);
        $this->nodeNameStack = [];

        if ($targetPath !== '/') {
            $pathSegments = explode('/', $targetPath);
            array_shift($pathSegments);
            $this->nodeNameStack = array_map(function ($pathSegment) {
                return Utility::renderValidNodeName($pathSegment);
            }, $pathSegments);
        }

        $formatVersion = $this->determineFormatVersion($xmlReader);
        switch ($formatVersion) {
            case self::SUPPORTED_FORMAT_VERSION:
                $this->securityContext->withoutAuthorizationChecks(function () use ($xmlReader) {
                    $this->importSubtree($xmlReader);
                });
                break;
            case null:
                throw new ImportException('Failed to recognize format of the Node Data XML to import. Please make sure that you use a valid Node Data XML structure.', 1409059346);
            default:
                throw new ImportException('Failed to import Node Data XML: The format with version ' . $formatVersion . ' is not supported, only version ' . self::SUPPORTED_FORMAT_VERSION . ' is supported.', 1409059352);
        }
    }