I know how to read content from an XML file, but I don't know how to write something into it.
For example, I read an integer variable from an XML file and modify it. After modifying, I want to save the integer variable to the same XML file. The old integer value must be replaced with the new value. My game runs on Windows 7.
I load the XML file with this code:
protected override void LoadContent()
{
scorexml = Content.Load<List<Gamescore>>("Score");
foreach (Gamescore score in scorexml)
{
score.Load(Content);
}
}
public class Gamescore
{
int score;
public int Score
{
get { return score; }
set { score = value; }
}
}