Append to large xml
<p>I am writting a program to store the details of songs to xml here is my code</p>

<pre><code>            private XmlDocument mediaXmlDoc = new XmlDocument();
            private XmlNode rootNode;

            mediaXmlDoc.RemoveAll();

            rootNode = mediaXmlDoc.CreateElement("filelist");
            mediaXmlDoc.AppendChild(rootNode);
</code></pre>

<p>And for each song i am appending the details like below</p>

<pre><code>            XmlNode file = mediaXmlDoc.CreateElement("file");                

            XmlNode filename = mediaXmlDoc.CreateElement("filename");
            filename.InnerText = FileName;
            file.AppendChild(filename);

            XmlNode path = mediaXmlDoc.CreateElement("path");
            path.InnerText = Path;
            file.AppendChild(path);

            XmlNode ext = mediaXmlDoc.CreateElement("ext");
            ext.InnerText = Ext;
            file.AppendChild(ext);

            XmlNode artist_name = mediaXmlDoc.CreateElement("artist_name");
            artist_name.InnerText = ArtistNameString;
            file.AppendChild(artist_name);

            XmlNode song_title = mediaXmlDoc.CreateElement("song_title");
            song_title.InnerText = SongTitleString;
            file.AppendChild(song_title);

            XmlNode genre = mediaXmlDoc.CreateElement("genre");
            genre.InnerText = GenreString;
            file.AppendChild(genre);

            XmlNode comments = mediaXmlDoc.CreateElement("comments");
            comments.InnerText = CommentsString;
            file.AppendChild(comments);

            XmlNode album_name = mediaXmlDoc.CreateElement("album_name");
            album_name.InnerText = AlbumNameString;
            file.AppendChild(album_name);

            XmlNode year = mediaXmlDoc.CreateElement("year");
            year.InnerText = YearString;
            file.AppendChild(year);

            XmlNode track_number = mediaXmlDoc.CreateElement("track_number");
            track_number.InnerText = TrackNumberString;
            file.AppendChild(track_number);

            XmlNode duration = mediaXmlDoc.CreateElement("duration");
            duration.InnerText = DurationString;
            file.AppendChild(duration);

            XmlNode bit_rate = mediaXmlDoc.CreateElement("bit_rate");
            bit_rate.InnerText = BitRateString;
            file.AppendChild(bit_rate);

            XmlNode protected_media = mediaXmlDoc.CreateElement("protected");
            protected_media.InnerText = ProtectedString;
            file.AppendChild(protected_media);

            XmlNode sample_rate = mediaXmlDoc.CreateElement("sample_rate");
            sample_rate.InnerText = SampleRateString;
            file.AppendChild(sample_rate);

            XmlNode channels = mediaXmlDoc.CreateElement("channels");
            channels.InnerText = ChannelsString;
            file.AppendChild(channels);

            rootNode.AppendChild(file);
</code></pre>

<p>and my problem is as the size of the xml increases the append speed feels to decrease what can i do to solve this performance issue</p>

<p>Thanks,</p>
