Writing to XML resource file through serialization
<p>So I'm writing a C# app that has a couple of XML files added as resources. I read from these XML files to populate objects in the code using XML serialization and it works perfectly. So I can access the files like so (I've left some code out, just have the important bits):</p>

<pre><code>using TestApp.Properties;

XmlSerializer serializer = new XmlSerializer(typeof(MapTiles));
StringReader sr = new StringReader(Resources.Maps);
mapTiles = (MapTiles)serializer.Deserialize(sr);
</code></pre>

<p>Now however, I'd like to do the opposite. I'd like to take some data and write it to these XML resource files. However, I seem to be running into trouble with this aspect and was hoping someone could see something I'm messing up or let me know what I need to do? Here's what I'm trying to do:</p>

<pre><code>XmlSerializer serializer = new XmlSerializer(typeof(MapTiles));
TextWriter writer = new StreamWriter(Resources.Maps);
serializer.Serialize(writer, tempGroup);
writer.Close();
</code></pre>

<p>When I run this code though, I get an error on the 2nd line that says <strong>ArgumentException was unhandled - Empty path name is not legal.</strong></p>

<p>So if anyone has any thoughts I would greatly appreciate some tips. Thanks so much.</p>
