/// <summary>
        ///   ReadLine - reads the next GEDCOM record from the buffer
        /// </summary>
        /// <returns>A GEDCOM Record</returns>
        public GEDCOMRecord ReadRecord()
        {
            //Declare Variable
            GEDCOMRecord record = null;

            if (_nextRecord != null)
            {
                record = _nextRecord;

                //Load the next record into the buffer
                GetNextRecord();

                while (_nextRecord != null)
                {
                    if (_nextRecord.Level == record.Level + 1)
                    {
                        switch (_nextRecord.TagName)
                        {
                        // Concatenate.
                        case GEDCOMTag.CONC:
                            record.AppendData(_nextRecord.Data);
                            GetNextRecord();
                            break;

                        // Continue, add record return and then the text.
                        case GEDCOMTag.CONT:
                            record.AppendData("\n" + _nextRecord.Data);
                            GetNextRecord();
                            break;

                        //Add child lines
                        default:
                            GEDCOMRecord childLine = ReadRecord();
                            if (childLine != null)
                            {
                                record.ChildRecords.Add(childLine);
                            }
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (record == null)
            {
                return(null);
            }

            //Pass to RecordFactory to convert the record into the relevant subclass
            return(GEDCOMRecordFactory.Create(record));
        }