/// <summary>
        /// Ensures that two Paragraph have matching GUID, and recursively.
        /// obj is the leader for Guid. If other doesn't match obj guid, 
        ///   1. other does not have a guid, in that case, other should have the same guid as obj
        ///   2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void ensureGuidParagraph(Generated.Paragraph obj, Generated.Paragraph other)
        {
            if ( obj == null )
            {
                if ( other != null )
                {
                    // Side effect, setup a GUID if needed for the other part (other)
                    string guid = other.Guid;
                }
                return;
            }

            if ( other == null )
            {
                if ( obj != null )
                {
                    // Side effect, setup a GUID if needed for the other part (obj)
                    string guid = obj.Guid;
                }
                return;
            }

            if ( obj.Guid != other.getGuid() )
            {
                if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
                {
                    // These are matching elements, copy the guid from  obj
                    other.setGuid ( obj.Guid );
                }
                else
                {
                    // Elements do not match. Stop the recursive process
                    return;
                }
            }

            ensureGuidReferencesParagraph (obj, other);

            if ( obj.allParagraphs() != null )
            {
                if ( other.allParagraphs() != null )
                {
                    foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.getId(), otherElement.getId()) && otherElement.getGuid() == null )
                            {
                                ensureGuidParagraph ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.getId(), otherElement.getId()) )
                                {
                                    ensureGuidParagraph ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidParagraph ( subElement, null );
                        }
                    }

                    foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                    {
                        bool found = false;
                        foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.getId(), otherElement.getId()) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidParagraph ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                    {
                        ensureGuidParagraph ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allParagraphs() != null )
                {
                    foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                    {
                        ensureGuidParagraph ( null, otherElement );
                    }
                }
            }
            ensureGuidParagraphRevision ( obj.getRevision(), other.getRevision() );
            if ( obj.allRequirementSets() != null )
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidRequirementSetReference ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidRequirementSetReference ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidRequirementSetReference ( subElement, null );
                        }
                    }

                    foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                    {
                        bool found = false;
                        foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidRequirementSetReference ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                    {
                        ensureGuidRequirementSetReference ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                    {
                        ensureGuidRequirementSetReference ( null, otherElement );
                    }
                }
            }
        }
        /// <summary>
        /// Ensures that two Dictionary have matching GUID, and recursively.
        /// obj is the leader for Guid. If other doesn't match obj guid, 
        ///   1. other does not have a guid, in that case, other should have the same guid as obj
        ///   2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void ensureGuidDictionary(Generated.Dictionary obj, Generated.Dictionary other)
        {
            if ( obj == null )
            {
                if ( other != null )
                {
                    // Side effect, setup a GUID if needed for the other part (other)
                    string guid = other.Guid;
                }
                return;
            }

            if ( other == null )
            {
                if ( obj != null )
                {
                    // Side effect, setup a GUID if needed for the other part (obj)
                    string guid = obj.Guid;
                }
                return;
            }

            if ( obj.Guid != other.getGuid() )
            {
                if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
                {
                    // These are matching elements, copy the guid from  obj
                    other.setGuid ( obj.Guid );
                }
                else
                {
                    // Elements do not match. Stop the recursive process
                    return;
                }
            }

            if ( obj.allSpecifications() != null )
            {
                if ( other.allSpecifications() != null )
                {
                    foreach ( Generated.Specification subElement in obj.allSpecifications() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.Specification otherElement in other.allSpecifications() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidSpecification ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.Specification otherElement in other.allSpecifications() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidSpecification ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidSpecification ( subElement, null );
                        }
                    }

                    foreach ( Generated.Specification otherElement in other.allSpecifications() )
                    {
                        bool found = false;
                        foreach ( Generated.Specification subElement in obj.allSpecifications() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidSpecification ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.Specification subElement in obj.allSpecifications() )
                    {
                        ensureGuidSpecification ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allSpecifications() != null )
                {
                    foreach ( Generated.Specification otherElement in other.allSpecifications() )
                    {
                        ensureGuidSpecification ( null, otherElement );
                    }
                }
            }
            if ( obj.allRequirementSets() != null )
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidRequirementSet ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidRequirementSet ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidRequirementSet ( subElement, null );
                        }
                    }

                    foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                    {
                        bool found = false;
                        foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidRequirementSet ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
                    {
                        ensureGuidRequirementSet ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                    {
                        ensureGuidRequirementSet ( null, otherElement );
                    }
                }
            }
            if ( obj.allRuleDisablings() != null )
            {
                if ( other.allRuleDisablings() != null )
                {
                    foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidRuleDisabling ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidRuleDisabling ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidRuleDisabling ( subElement, null );
                        }
                    }

                    foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                    {
                        bool found = false;
                        foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidRuleDisabling ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
                    {
                        ensureGuidRuleDisabling ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allRuleDisablings() != null )
                {
                    foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                    {
                        ensureGuidRuleDisabling ( null, otherElement );
                    }
                }
            }
            if ( obj.allNameSpaces() != null )
            {
                if ( other.allNameSpaces() != null )
                {
                    foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidNameSpace ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidNameSpace ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidNameSpace ( subElement, null );
                        }
                    }

                    foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                    {
                        bool found = false;
                        foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidNameSpace ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
                    {
                        ensureGuidNameSpace ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allNameSpaces() != null )
                {
                    foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                    {
                        ensureGuidNameSpace ( null, otherElement );
                    }
                }
            }
            if ( obj.allNameSpaceRefs() != null )
            {
                if ( other.allNameSpaceRefs() != null )
                {
                    foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidNameSpaceRef ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidNameSpaceRef ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidNameSpaceRef ( subElement, null );
                        }
                    }

                    foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                    {
                        bool found = false;
                        foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidNameSpaceRef ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
                    {
                        ensureGuidNameSpaceRef ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allNameSpaceRefs() != null )
                {
                    foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                    {
                        ensureGuidNameSpaceRef ( null, otherElement );
                    }
                }
            }
            if ( obj.allTests() != null )
            {
                if ( other.allTests() != null )
                {
                    foreach ( Generated.Frame subElement in obj.allTests() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.Frame otherElement in other.allTests() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidFrame ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.Frame otherElement in other.allTests() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidFrame ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidFrame ( subElement, null );
                        }
                    }

                    foreach ( Generated.Frame otherElement in other.allTests() )
                    {
                        bool found = false;
                        foreach ( Generated.Frame subElement in obj.allTests() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidFrame ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.Frame subElement in obj.allTests() )
                    {
                        ensureGuidFrame ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allTests() != null )
                {
                    foreach ( Generated.Frame otherElement in other.allTests() )
                    {
                        ensureGuidFrame ( null, otherElement );
                    }
                }
            }
            if ( obj.allTestRefs() != null )
            {
                if ( other.allTestRefs() != null )
                {
                    foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidFrameRef ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidFrameRef ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidFrameRef ( subElement, null );
                        }
                    }

                    foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                    {
                        bool found = false;
                        foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidFrameRef ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
                    {
                        ensureGuidFrameRef ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allTestRefs() != null )
                {
                    foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                    {
                        ensureGuidFrameRef ( null, otherElement );
                    }
                }
            }
            ensureGuidTranslationDictionary ( obj.getTranslationDictionary(), other.getTranslationDictionary() );
            ensureGuidShortcutDictionary ( obj.getShortcutDictionary(), other.getShortcutDictionary() );
        }
        /// <summary>
        /// Compares two Dictionary and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareDictionary(Generated.Dictionary obj, Generated.Dictionary other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            if ( obj.allSpecifications() != null )
            {
                if ( other.allSpecifications() != null )
                {
                    foreach ( Generated.Specification subElement in obj.allSpecifications() )
                    {
                        bool compared = false;
                        foreach ( Generated.Specification otherElement in other.allSpecifications() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareSpecification ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Specifications", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.Specification otherElement in other.allSpecifications() )
                    {
                        bool found = false;
                        foreach ( Generated.Specification subElement in obj.allSpecifications() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Specifications", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.Specification subElement in obj.allSpecifications() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Specifications", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allSpecifications() != null )
                {
                    foreach ( Generated.Specification otherElement in other.allSpecifications() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Specifications", otherElement.Name) );
                    }
                }
            }
            if ( obj.allRequirementSets() != null )
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
                    {
                        bool compared = false;
                        foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareRequirementSet ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "RequirementSets", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                    {
                        bool found = false;
                        foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "RequirementSets", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "RequirementSets", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSet otherElement in other.allRequirementSets() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "RequirementSets", otherElement.Name) );
                    }
                }
            }
            if ( obj.allRuleDisablings() != null )
            {
                if ( other.allRuleDisablings() != null )
                {
                    foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
                    {
                        bool compared = false;
                        foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareRuleDisabling ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "RuleDisablings", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                    {
                        bool found = false;
                        foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "RuleDisablings", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "RuleDisablings", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allRuleDisablings() != null )
                {
                    foreach ( Generated.RuleDisabling otherElement in other.allRuleDisablings() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "RuleDisablings", otherElement.Name) );
                    }
                }
            }
            if ( obj.allNameSpaces() != null )
            {
                if ( other.allNameSpaces() != null )
                {
                    foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
                    {
                        bool compared = false;
                        foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareNameSpace ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "NameSpaces", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                    {
                        bool found = false;
                        foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "NameSpaces", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "NameSpaces", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allNameSpaces() != null )
                {
                    foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "NameSpaces", otherElement.Name) );
                    }
                }
            }
            if ( obj.allNameSpaceRefs() != null )
            {
                if ( other.allNameSpaceRefs() != null )
                {
                    foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
                    {
                        bool compared = false;
                        foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareNameSpaceRef ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "NameSpaceRefs", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                    {
                        bool found = false;
                        foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "NameSpaceRefs", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "NameSpaceRefs", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allNameSpaceRefs() != null )
                {
                    foreach ( Generated.NameSpaceRef otherElement in other.allNameSpaceRefs() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "NameSpaceRefs", otherElement.Name) );
                    }
                }
            }
            if ( obj.allTests() != null )
            {
                if ( other.allTests() != null )
                {
                    foreach ( Generated.Frame subElement in obj.allTests() )
                    {
                        bool compared = false;
                        foreach ( Generated.Frame otherElement in other.allTests() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareFrame ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Tests", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.Frame otherElement in other.allTests() )
                    {
                        bool found = false;
                        foreach ( Generated.Frame subElement in obj.allTests() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Tests", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.Frame subElement in obj.allTests() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Tests", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allTests() != null )
                {
                    foreach ( Generated.Frame otherElement in other.allTests() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Tests", otherElement.Name) );
                    }
                }
            }
            if ( obj.allTestRefs() != null )
            {
                if ( other.allTestRefs() != null )
                {
                    foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
                    {
                        bool compared = false;
                        foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareFrameRef ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "TestRefs", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                    {
                        bool found = false;
                        foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "TestRefs", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "TestRefs", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allTestRefs() != null )
                {
                    foreach ( Generated.FrameRef otherElement in other.allTestRefs() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "TestRefs", otherElement.Name) );
                    }
                }
            }
            if ( obj.getTranslationDictionary() == null )
            {
                if ( other.getTranslationDictionary() != null )
                {
                    diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "TranslationDictionary", "" ) );
                }
            }
            else
            {
                compareTranslationDictionary ( obj.getTranslationDictionary(), other.getTranslationDictionary(), diff );
            }
            if ( obj.getShortcutDictionary() == null )
            {
                if ( other.getShortcutDictionary() != null )
                {
                    diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "ShortcutDictionary", "" ) );
                }
            }
            else
            {
                compareShortcutDictionary ( obj.getShortcutDictionary(), other.getShortcutDictionary(), diff );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getXsi(), other.getXsi()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Xsi", other.getXsi(), obj.getXsi()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getXsiLocation(), other.getXsiLocation()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "XsiLocation", other.getXsiLocation(), obj.getXsiLocation()) );
            }
        }
        /// <summary>
        /// Compares two Paragraph and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareParagraph(Generated.Paragraph obj, Generated.Paragraph other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            compareReferencesParagraph (obj, other, diff);

            if ( !CompareUtil.canonicalStringEquality(obj.getId(), other.getId()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Id", other.getId(), obj.getId()) );
            }
            if ( obj.getType() != other.getType() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Type", other.getType().ToString(), obj.getType().ToString()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getBl(), other.getBl()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Bl", other.getBl(), obj.getBl()) );
            }
            if ( obj.getOptional() != other.getOptional() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Optional", other.getOptional().ToString(), obj.getOptional().ToString()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getText(), other.getText()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Text", other.getText(), obj.getText()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getVersion(), other.getVersion()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Version", other.getVersion(), obj.getVersion()) );
            }
            if ( obj.getReviewed() != other.getReviewed() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Reviewed", other.getReviewed().ToString(), obj.getReviewed().ToString()) );
            }
            if ( obj.getImplementationStatus() != other.getImplementationStatus() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "ImplementationStatus", other.getImplementationStatus().ToString(), obj.getImplementationStatus().ToString()) );
            }
            if ( obj.allParagraphs() != null )
            {
                if ( other.allParagraphs() != null )
                {
                    foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                    {
                        bool compared = false;
                        foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareParagraph ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Paragraphs", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                    {
                        bool found = false;
                        foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Paragraphs", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Paragraphs", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allParagraphs() != null )
                {
                    foreach ( Generated.Paragraph otherElement in other.allParagraphs() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Paragraphs", otherElement.Name) );
                    }
                }
            }
            if ( obj.getRevision() == null )
            {
                if ( other.getRevision() != null )
                {
                    diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Revision", "" ) );
                }
            }
            else
            {
                compareParagraphRevision ( obj.getRevision(), other.getRevision(), diff );
            }
            if ( obj.getMoreInfoRequired() != other.getMoreInfoRequired() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "MoreInfoRequired", other.getMoreInfoRequired().ToString(), obj.getMoreInfoRequired().ToString()) );
            }
            if ( obj.getSpecIssue() != other.getSpecIssue() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "SpecIssue", other.getSpecIssue().ToString(), obj.getSpecIssue().ToString()) );
            }
            if ( obj.allRequirementSets() != null )
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                    {
                        bool compared = false;
                        foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareRequirementSetReference ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "RequirementSets", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                    {
                        bool found = false;
                        foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "RequirementSets", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "RequirementSets", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allRequirementSets() != null )
                {
                    foreach ( Generated.RequirementSetReference otherElement in other.allRequirementSets() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "RequirementSets", otherElement.Name) );
                    }
                }
            }
            if ( obj.getTested() != other.getTested() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Tested", other.getTested().ToString(), obj.getTested().ToString()) );
            }
        }
        /// <summary>
        /// Searches a specific string in Paragraph and updates the list 
        /// of model element with all the elements in which that string is found
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="obj">The string to search for</param>
        /// <param name="occurences">The list of model elements which hold the searched string</param>
        public static void searchParagraph(Generated.Paragraph obj, string searchString, List<ModelElement> occurences)
        {
            searchReferencesParagraph (obj, searchString, occurences);

            if ( obj.getId() != null && obj.getId().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.getBl() != null && obj.getBl().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.getText() != null && obj.getText().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.getVersion() != null && obj.getVersion().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.allParagraphs() != null )
            {
                foreach ( Generated.Paragraph subElement in obj.allParagraphs() )
                {
                    searchParagraph ( subElement, searchString, occurences );
                }
            }
            if ( obj.getRevision() != null )
            {
                searchParagraphRevision ( obj.getRevision(), searchString, occurences );
            }
            if ( obj.getObsoleteFunctionalBlockName() != null && obj.getObsoleteFunctionalBlockName().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.allRequirementSets() != null )
            {
                foreach ( Generated.RequirementSetReference subElement in obj.allRequirementSets() )
                {
                    searchRequirementSetReference ( subElement, searchString, occurences );
                }
            }
            if ( obj.getObsoleteGuid() != null && obj.getObsoleteGuid().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
        }
 /// <summary>
 /// Searches a specific string in Dictionary and updates the list 
 /// of model element with all the elements in which that string is found
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="obj">The string to search for</param>
 /// <param name="occurences">The list of model elements which hold the searched string</param>
 public static void searchDictionary(Generated.Dictionary obj, string searchString, List<ModelElement> occurences)
 {
     if ( obj.allSpecifications() != null )
     {
         foreach ( Generated.Specification subElement in obj.allSpecifications() )
         {
             searchSpecification ( subElement, searchString, occurences );
         }
     }
     if ( obj.allRequirementSets() != null )
     {
         foreach ( Generated.RequirementSet subElement in obj.allRequirementSets() )
         {
             searchRequirementSet ( subElement, searchString, occurences );
         }
     }
     if ( obj.allRuleDisablings() != null )
     {
         foreach ( Generated.RuleDisabling subElement in obj.allRuleDisablings() )
         {
             searchRuleDisabling ( subElement, searchString, occurences );
         }
     }
     if ( obj.allNameSpaces() != null )
     {
         foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
         {
             searchNameSpace ( subElement, searchString, occurences );
         }
     }
     if ( obj.allNameSpaceRefs() != null )
     {
         foreach ( Generated.NameSpaceRef subElement in obj.allNameSpaceRefs() )
         {
             searchNameSpaceRef ( subElement, searchString, occurences );
         }
     }
     if ( obj.allTests() != null )
     {
         foreach ( Generated.Frame subElement in obj.allTests() )
         {
             searchFrame ( subElement, searchString, occurences );
         }
     }
     if ( obj.allTestRefs() != null )
     {
         foreach ( Generated.FrameRef subElement in obj.allTestRefs() )
         {
             searchFrameRef ( subElement, searchString, occurences );
         }
     }
     if ( obj.getTranslationDictionary() != null )
     {
         searchTranslationDictionary ( obj.getTranslationDictionary(), searchString, occurences );
     }
     if ( obj.getShortcutDictionary() != null )
     {
         searchShortcutDictionary ( obj.getShortcutDictionary(), searchString, occurences );
     }
     if ( obj.getXsi() != null && obj.getXsi().Contains (searchString) )
     {
         occurences.Add ( obj );
     }
     if ( obj.getXsiLocation() != null && obj.getXsiLocation().Contains (searchString) )
     {
         occurences.Add ( obj );
     }
 }