public async Task CanToWriteAsyncRealCollectioToRealFileTest()
        {
            List <IElement> library;
            var             settings    = new LibrarySettings();
            var             outSettings = new OutputSettings();

            var stream = new FileStream(PathStrings.FileToRead, FileMode.Open);

            using (stream)
            {
                library = new LibraryReader <IElement>(stream, settings).ToList();
            }

            stream = new FileStream(PathStrings.FileToAsyncWrite, FileMode.Create);
            using (stream)
            {
                var writer = new LibraryWriter <IElement>(library, settings);
                await writer.WriteXElementsAsync(stream, outSettings);
            }
        }
        private async Task <string> WriteXmlStringAsync <T>(List <T> collection, bool withFailSettings = false) where T : class
        {
            var outSettings = new OutputSettings();
            var settings    = new LibrarySettings();

            if (withFailSettings)
            {
                settings.MainElementName = null;
            }
            var    stream = new MemoryStream();
            string result;

            using (stream)
            {
                var writer = new LibraryWriter <T>(collection, settings);
                await writer.WriteXElementsAsync(stream, outSettings);

                stream.Position = 0;
                result          = await new StreamReader(stream).ReadToEndAsync();
            }

            return(result);
        }