def generateXSDataIndexingResult(_xsDataMOSFLMIndexingOutput,
                                     _xsDataExperimentalCondition=None):
        """
        Translation from XSDataMOSFLMIndexingOutput to XSDataIndexingResult.
        """
        EDVerbose.DEBUG(
            "EDHandlerXSDataMOSFLMv10.generateXSDataIndexingOutput")
        xsDataMOSFLMBeamPositionRefined = _xsDataMOSFLMIndexingOutput.getRefinedBeam(
        )
        xsDataMOSFLMBeamPositionShift = _xsDataMOSFLMIndexingOutput.getBeamShift(
        )
        dDeviationAngular = _xsDataMOSFLMIndexingOutput.getDeviationAngular(
        ).getValue()
        dDeviationPositional = _xsDataMOSFLMIndexingOutput.getDeviationPositional(
        ).getValue()
        dMosaicityEstimation = _xsDataMOSFLMIndexingOutput.getMosaicityEstimation(
        ).getValue()
        dDistanceRefined = _xsDataMOSFLMIndexingOutput.getRefinedDistance(
        ).getValue()
        iSelectedSolution = _xsDataMOSFLMIndexingOutput.getSelectedSolutionNumber(
        ).getValue()
        iSpotsTotal = _xsDataMOSFLMIndexingOutput.getSpotsTotal().getValue()
        iSpotsUsed = _xsDataMOSFLMIndexingOutput.getSpotsUsed().getValue()
        xsDataCellRefined = _xsDataMOSFLMIndexingOutput.getRefinedNewmat(
        ).getRefinedCell()
        xsDataMatrixA = _xsDataMOSFLMIndexingOutput.getRefinedNewmat(
        ).getAMatrix()
        xsDataMatrixU = _xsDataMOSFLMIndexingOutput.getRefinedNewmat(
        ).getUMatrix()
        strSelectedSpaceGroupName = _xsDataMOSFLMIndexingOutput.getSelectedSolutionSpaceGroup(
        ).getValue()
        iSelectedSpaceGroupNumber = _xsDataMOSFLMIndexingOutput.getSelectedSolutionSpaceGroupNumber(
        ).getValue()

        xsDataIndexingResult = XSDataIndexingResult()
        xsDataIndexingSolutionSelected = None

        for possibleSolutions in _xsDataMOSFLMIndexingOutput.getPossibleSolutions(
        ):
            xsDataCrystal = XSDataCrystal()
            xsDataSpaceGroup = XSDataSpaceGroup()
            xsDataSpaceGroup.setName(
                XSDataString(possibleSolutions.getLattice().getValue()))
            xsDataCrystal.setSpaceGroup(xsDataSpaceGroup)
            xsDataCrystal.setCell(possibleSolutions.getCell())
            xsDataIndexingSolution = XSDataIndexingSolution()
            xsDataIndexingSolution.setCrystal(xsDataCrystal)
            iIndex = possibleSolutions.getIndex().getValue()
            xsDataIndexingSolution.setNumber(XSDataInteger(iIndex))
            xsDataIndexingSolution.setPenalty(
                XSDataFloat(possibleSolutions.getPenalty().getValue()))
            xsDataIndexingResult.addSolution(xsDataIndexingSolution)
            if (iIndex == iSelectedSolution):
                xsDataIndexingSolutionSelected = XSDataIndexingSolutionSelected(
                )
                xsDataIndexingSolutionSelected.setNumber(XSDataInteger(iIndex))
                xsDataIndexingSolutionSelected.setPenalty(
                    XSDataFloat(possibleSolutions.getPenalty().getValue()))

        xsDataCrystalSelected = XSDataCrystal()
        xsDataSpaceGroupSelected = XSDataSpaceGroup()
        xsDataSpaceGroupSelected.setName(
            XSDataString(strSelectedSpaceGroupName))
        xsDataSpaceGroupSelected.setITNumber(
            XSDataInteger(iSelectedSpaceGroupNumber))
        xsDataCrystalSelected.setSpaceGroup(xsDataSpaceGroupSelected)
        xsDataCrystalSelected.setCell(xsDataCellRefined)
        xsDataCrystalSelected.setMosaicity(XSDataDouble(dMosaicityEstimation))
        xsDataIndexingSolutionSelected.setCrystal(xsDataCrystalSelected)

        xsDataOrientation = XSDataOrientation()
        xsDataOrientation.setMatrixA(xsDataMatrixA)
        xsDataOrientation.setMatrixU(xsDataMatrixU)
        xsDataIndexingSolutionSelected.setOrientation(xsDataOrientation)

        xsDataStatisticsIndexing = XSDataStatisticsIndexing()

        xsDataStatisticsIndexing.setBeamPositionShiftX(
            XSDataLength(xsDataMOSFLMBeamPositionShift.getX().getValue()))
        xsDataStatisticsIndexing.setBeamPositionShiftY(
            XSDataLength(xsDataMOSFLMBeamPositionShift.getY().getValue()))
        xsDataStatisticsIndexing.setSpotDeviationAngular(
            XSDataAngle(dDeviationAngular))
        xsDataStatisticsIndexing.setSpotDeviationPositional(
            XSDataLength(dDeviationPositional))
        xsDataStatisticsIndexing.setSpotsUsed(XSDataInteger(iSpotsUsed))
        xsDataStatisticsIndexing.setSpotsTotal(XSDataInteger(iSpotsTotal))
        xsDataIndexingSolutionSelected.setStatistics(xsDataStatisticsIndexing)

        xsDataExperimentalConditionRefined = None
        if (_xsDataExperimentalCondition is None):
            xsDataExperimentalConditionRefined = XSDataExperimentalCondition()
        else:
            # Copy the incoming experimental condition
            xmlExperimentalCondition = _xsDataExperimentalCondition.marshal()
            xsDataExperimentalConditionRefined = XSDataExperimentalCondition.parseString(
                xmlExperimentalCondition)

        xsDataDetector = xsDataExperimentalConditionRefined.getDetector()
        if (xsDataDetector is None):
            xsDataDetector = XSDataDetector()

        xsDataDetector.setBeamPositionX(
            XSDataLength(xsDataMOSFLMBeamPositionRefined.getX().getValue()))
        xsDataDetector.setBeamPositionY(
            XSDataLength(xsDataMOSFLMBeamPositionRefined.getY().getValue()))
        xsDataDetector.setDistance(XSDataLength(dDistanceRefined))

        xsDataExperimentalConditionRefined.setDetector(xsDataDetector)
        xsDataIndexingSolutionSelected.setExperimentalConditionRefined(
            xsDataExperimentalConditionRefined)

        xsDataIndexingResult.setSelectedSolution(
            xsDataIndexingSolutionSelected)

        xsDataIndexingResult.setIndexingLogFile(
            _xsDataMOSFLMIndexingOutput.getPathToLogFile())

        return xsDataIndexingResult
    def generateXSDataIndexingResult(_xsDataMOSFLMIndexingOutput, _xsDataExperimentalCondition=None):
        """
        Translation from XSDataMOSFLMIndexingOutput to XSDataIndexingResult.
        """
        EDVerbose.DEBUG("EDHandlerXSDataMOSFLMv10.generateXSDataIndexingOutput")
        xsDataMOSFLMBeamPositionRefined = _xsDataMOSFLMIndexingOutput.getRefinedBeam()
        xsDataMOSFLMBeamPositionShift = _xsDataMOSFLMIndexingOutput.getBeamShift()
        dDeviationAngular = _xsDataMOSFLMIndexingOutput.getDeviationAngular().getValue()
        dDeviationPositional = _xsDataMOSFLMIndexingOutput.getDeviationPositional().getValue()
        dMosaicityEstimation = _xsDataMOSFLMIndexingOutput.getMosaicityEstimation().getValue()
        dDistanceRefined = _xsDataMOSFLMIndexingOutput.getRefinedDistance().getValue()
        iSelectedSolution = _xsDataMOSFLMIndexingOutput.getSelectedSolutionNumber().getValue()
        iSpotsTotal = _xsDataMOSFLMIndexingOutput.getSpotsTotal().getValue()
        iSpotsUsed = _xsDataMOSFLMIndexingOutput.getSpotsUsed().getValue()
        xsDataCellRefined = _xsDataMOSFLMIndexingOutput.getRefinedNewmat().getRefinedCell()
        xsDataMatrixA = _xsDataMOSFLMIndexingOutput.getRefinedNewmat().getAMatrix()
        xsDataMatrixU = _xsDataMOSFLMIndexingOutput.getRefinedNewmat().getUMatrix()
        strSelectedSpaceGroupName = _xsDataMOSFLMIndexingOutput.getSelectedSolutionSpaceGroup().getValue()
        iSelectedSpaceGroupNumber = _xsDataMOSFLMIndexingOutput.getSelectedSolutionSpaceGroupNumber().getValue()

        xsDataIndexingResult = XSDataIndexingResult()
        xsDataIndexingSolutionSelected = None

        for possibleSolutions in _xsDataMOSFLMIndexingOutput.getPossibleSolutions():
            xsDataCrystal = XSDataCrystal()
            xsDataSpaceGroup = XSDataSpaceGroup()
            xsDataSpaceGroup.setName(XSDataString(possibleSolutions.getLattice().getValue()))
            xsDataCrystal.setSpaceGroup(xsDataSpaceGroup)
            xsDataCrystal.setCell(possibleSolutions.getCell())
            xsDataIndexingSolution = XSDataIndexingSolution()
            xsDataIndexingSolution.setCrystal(xsDataCrystal)
            iIndex = possibleSolutions.getIndex().getValue()
            xsDataIndexingSolution.setNumber(XSDataInteger(iIndex))
            xsDataIndexingSolution.setPenalty(XSDataFloat(possibleSolutions.getPenalty().getValue()))
            xsDataIndexingResult.addSolution(xsDataIndexingSolution)
            if (iIndex == iSelectedSolution):
                xsDataIndexingSolutionSelected = XSDataIndexingSolutionSelected()
                xsDataIndexingSolutionSelected.setNumber(XSDataInteger(iIndex))
                xsDataIndexingSolutionSelected.setPenalty(XSDataFloat(possibleSolutions.getPenalty().getValue()))

        xsDataCrystalSelected = XSDataCrystal()
        xsDataSpaceGroupSelected = XSDataSpaceGroup()
        xsDataSpaceGroupSelected.setName(XSDataString(strSelectedSpaceGroupName))
        xsDataSpaceGroupSelected.setITNumber(XSDataInteger(iSelectedSpaceGroupNumber))
        xsDataCrystalSelected.setSpaceGroup(xsDataSpaceGroupSelected)
        xsDataCrystalSelected.setCell(xsDataCellRefined)
        xsDataCrystalSelected.setMosaicity(XSDataDouble(dMosaicityEstimation))
        xsDataIndexingSolutionSelected.setCrystal(xsDataCrystalSelected)

        xsDataOrientation = XSDataOrientation()
        xsDataOrientation.setMatrixA(xsDataMatrixA)
        xsDataOrientation.setMatrixU(xsDataMatrixU)
        xsDataIndexingSolutionSelected.setOrientation(xsDataOrientation)

        xsDataStatisticsIndexing = XSDataStatisticsIndexing()

        xsDataStatisticsIndexing.setBeamPositionShiftX(XSDataLength(xsDataMOSFLMBeamPositionShift.getX().getValue()))
        xsDataStatisticsIndexing.setBeamPositionShiftY(XSDataLength(xsDataMOSFLMBeamPositionShift.getY().getValue()))
        xsDataStatisticsIndexing.setSpotDeviationAngular(XSDataAngle(dDeviationAngular))
        xsDataStatisticsIndexing.setSpotDeviationPositional(XSDataLength(dDeviationPositional))
        xsDataStatisticsIndexing.setSpotsUsed(XSDataInteger(iSpotsUsed))
        xsDataStatisticsIndexing.setSpotsTotal(XSDataInteger(iSpotsTotal))
        xsDataIndexingSolutionSelected.setStatistics(xsDataStatisticsIndexing)

        xsDataExperimentalConditionRefined = None
        if (_xsDataExperimentalCondition is None):
            xsDataExperimentalConditionRefined = XSDataExperimentalCondition()
        else:
            # Copy the incoming experimental condition
            xmlExperimentalCondition = _xsDataExperimentalCondition.marshal()
            xsDataExperimentalConditionRefined = XSDataExperimentalCondition.parseString(xmlExperimentalCondition)

        xsDataDetector = xsDataExperimentalConditionRefined.getDetector()
        if (xsDataDetector is None):
            xsDataDetector = XSDataDetector()

        xsDataDetector.setBeamPositionX(XSDataLength(xsDataMOSFLMBeamPositionRefined.getX().getValue()))
        xsDataDetector.setBeamPositionY(XSDataLength(xsDataMOSFLMBeamPositionRefined.getY().getValue()))
        xsDataDetector.setDistance(XSDataLength(dDistanceRefined))

        xsDataExperimentalConditionRefined.setDetector(xsDataDetector)
        xsDataIndexingSolutionSelected.setExperimentalConditionRefined(xsDataExperimentalConditionRefined)

        xsDataIndexingResult.setSelectedSolution(xsDataIndexingSolutionSelected)

        return xsDataIndexingResult