public override void VisitContainer(Container elements)
        {
            if (_topLevel)
            {
                _topLevel = false;
                for (var index = 0; index < elements.Count; index++)
                {
                    var element = elements[index];
                    var source  = element as Source;

                    if (source != null)
                    {
                        // remove empty source blocks
                        if (string.IsNullOrWhiteSpace(source.Text))
                        {
                            continue;
                        }

                        var method = source.Attributes.OfType <NamedAttribute>().FirstOrDefault(a => a.Name == "method");
                        if (method == null)
                        {
                            _newDocument.Add(source);
                            continue;
                        }

                        // if there is a section title since the last source block, don't add one
                        var lastSourceBlock  = _newDocument.LastOrDefault(e => e is Source);
                        var lastSectionTitle = _newDocument.OfType <SectionTitle>().LastOrDefault(e => e.Level == _topSectionTitleLevel + 1);
                        if (lastSourceBlock != null && lastSectionTitle != null)
                        {
                            var lastSectionTitleIndex = _newDocument.IndexOf(lastSectionTitle);
                            var lastSourceBlockIndex  = _newDocument.IndexOf(lastSourceBlock);
                            if (lastSectionTitleIndex > lastSourceBlockIndex)
                            {
                                _newDocument.Add(source);
                                continue;
                            }
                        }

                        switch (method.Value)
                        {
                        case "fluent":
                        case "queryfluent":
                        case "fluentaggs":
                            if (!LastSectionTitleMatches(text => text.StartsWith("Fluent DSL", StringComparison.OrdinalIgnoreCase)))
                            {
                                _newDocument.Add(CreateSubsectionTitle("Fluent DSL example"));
                            }

                            _newDocument.Add(source);
                            break;

                        case "initializer":
                        case "queryinitializer":
                        case "initializeraggs":
                            _newDocument.Add(CreateSubsectionTitle("Object Initializer syntax example"));
                            _newDocument.Add(source);
                            break;

                        case "expectresponse":
                            // Don't add the Handlng Response section title if it was the last title (it might be defined in the doc already)
                            if (!LastSectionTitleMatches(text => text.Equals("Handling responses", StringComparison.OrdinalIgnoreCase)))
                            {
                                _newDocument.Add(CreateSubsectionTitle("Handling Responses"));
                            }
                            _newDocument.Add(source);
                            break;

                        default:
                            _newDocument.Add(source);
                            break;
                        }
                    }
                    else
                    {
                        _newDocument.Add(element);
                    }
                }
            }

            base.VisitContainer(elements);
        }