Saving and Loading XML in Standalone

In my game, I have an arbitrary number of XML files that are used to load in map data and populate the map. Additionally, I want to automatically save to XML changes that players make to the map.

I currently have this working in the editor mode, but I can't get it to work in the standalone version.

The way I am saving and loading XML currently is using the System.Xml method. Here's a sample of my code:

/* WORLD SAVE DATA */
public void SerializeData(WorldSaveData saveData)
{
    Debug.Log("Saving world data...");
    XmlSerializer serializer = new XmlSerializer(typeof(WorldSaveData));
    TextWriter textWriter = new StreamWriter(Application.dataPath + "/data/world/worldsave.xml");
    serializer.Serialize(textWriter, saveData);
    textWriter.Close();

    Debug.Log("Saved to: " + Application.dataPath + "/data/world/worldsave.xml");
}

public WorldSaveData DeserializeData(WorldSaveData saveData)
{
    Debug.Log("Loading world data...");
    XmlSerializer serializer = new XmlSerializer(typeof(WorldSaveData));
    TextReader textReader = new StreamReader(Application.dataPath + "/data/world/worldsave.xml");
    saveData = (WorldSaveData)serializer.Deserialize(textReader);
    textReader.Close();

    Debug.Log("Loaded world data successfully.");
    return saveData;
}

This is functional and works well for me. Looking around, I saw that in standalone versions you might have to use the Resources folders and Resources.Load, but doing so only gives me a TextAsset, which I am unable to convert into the StreamWriter/TextWriter format I'd like to use if at all possible. Also, in my searches around I was only able to find people discussing loading XML data, but I need to ensure I can save data as well.

Hopefully some kind folks around here can help! Thanks for reading my question.

This isn't exactly a great "answer" to the question as much as a workaround, but here's what I've found:

So the workaround I'm using now is this:

  1. Copy the source folder for my xml files (in my case above, the entire "data" folder)
  2. Paste it into the dataPath folder for the build (in Windows, it's applicationName_Data)

I've found that it works in this way, even if it's not the most ideal solution. I'd still be happy to hear other suggestions.