Read AND Write to XML at runtime

I want to create a custom file save with XML (I don’t like the way PlayerPrefs does it) but from what I’ve read, the way I’m doing it right now won’t allow me to write/modify the file at runtime, which defeats the whole purpose of it. I don’t really care if the file is human-readable like the PlayerPrefs xml file is, as long as it’s read and write.

Here’s the script I’m using for accessing the file and whatnot, but there’s no write-to method yet (as that’s when I hit a hitch on the road):

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Xml.Serialization;
using System.IO;

public class XML_LevelCollection {

	[XmlArrayItem ("Level")]
	public List <XML_Level> Levels = new List <XML_Level>();

	public static XML_LevelCollection Load (string path) {

		TextAsset LevelContainerXML = Resources.Load <TextAsset> (path);

		XmlSerializer Serializer = new XmlSerializer (typeof (XML_LevelCollection));

		StringReader Reader = new StringReader (LevelContainerXML.text);

		XML_LevelCollection levels = Serializer.Deserialize (Reader) as XML_LevelCollection;

		Reader.Close ();

		return levels;



It’s all here :