private UserStory persistUserStory(Project project, Map<String, Release> projectReleases,
			HierarchicalRequirementType hierarchicalRequirementType, Iteration iteration) throws JAXBException {
		UserStory userStory = Mapper.mapUserStory(hierarchicalRequirementType);
		for (TaskType taskType : hierarchicalRequirementType.getTasks().getTask()) {
			taskType = persistTask(userStory, null, taskType);
		}
		for (DefectType defectType : hierarchicalRequirementType.getDefects().getDefect()) {
			defectType = findOne(defectType, DefectType.class);
			if (defectType.getRequirement() != null) {
				String reqRef = defectType.getRequirement().getRef();
				Long reqObjectID = Long.parseLong(reqRef.substring(reqRef.lastIndexOf('/') + 1));
				if (reqObjectID.equals(hierarchicalRequirementType.getObjectID())) {
					persistDefect(project, projectReleases, defectType, iteration, userStory);
				}
			}
		}
		for (TestCaseType testCaseType : hierarchicalRequirementType.getTestCases().getTestCase()) {
			testCaseType = persistTestCase(userStory, null, testCaseType);
		}
		for (AttachmentType attachmentType : hierarchicalRequirementType.getAttachments().getAttachment()) {
			persistAttachment(userStory, null, null, null, attachmentType);
		}
		em.persist(userStory);
		progressIndicator();

		project.getUserStories().add(userStory);
		Release release = findProjectReleaseForUserStory(projectReleases, hierarchicalRequirementType);
		if (release != null) {
			release.getUserStories().add(userStory);
		}
		if (iteration != null) {
			iteration.getUserStories().add(userStory);
		}

		for (HierarchicalRequirementType childUserStoryType : hierarchicalRequirementType.getChildren()
				.getHierarchicalRequirement()) {
			childUserStoryType = findOne(childUserStoryType, HierarchicalRequirementType.class);
			persistUserStory(project, projectReleases, childUserStoryType, iteration);
		}
		userStory.setMigrationComplete(true);
		em.persist(userStory);
		return userStory;
	}