//Check if the file exists so we do not override an existing file if (!File.Exists(fileName)) { xmlTextWriter = new XmlTextWriter(fileName, null); //Add the root node to the document if (startNode != null) { xmlTextWriter.WriteStartDocument(); xmlTextWriter.WriteStartElement(startNode); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteEndDocument(); } xmlTextWriter.Flush(); xmlTextWriter.Close(); }
<?xml version="1.0"?><Projectiles />