XML, TXT custom-generated keys (JS)

Hey, I have a harder problem:

Using System.IO, is it possible to have instances of a prefab create custom keys (eg prefabName_number_variable) and then somehow search for the keys and reload their values at runtime?

Ideally, it would work like this:

At runtime, if prefabName_id_variable : Key exists, read it. Else, create it.

As prefabName_id_variable changes, write the new value to an .xml, .txt, etc.

Now I can probably use something like

var prefabName : String = “CubePrefab”;
var instanceNumber : int = 3;
var customKeyForHealth : String = prefabName + “" + instanceNumber.ToString() + "” + “health”;

which would yield “CubePrefab_3_health” which is great, but how would I search out the key from the .xml, .txt, etc.? PlayerPrefs has funcitonality similar to this, but as far as I know there is very limited control over how many PlayerPrefs files there can be and where they are in the system. With custom .xml or .txt files for save games I can control the number and location of them.

Any help would be greatly appreciated, since this concept is pivotal to a good save game system.

I’d love to see a solution to this, I was thinking of somthing similar for the AI in one of my older games.

I think http://www.unifycommunity.com/wiki/index.php?title=Save_and_Load_from_XML may have a solid lead on what I’m trying to do. I’ll tinker around with it some more and see what I can come up with.