1)



I'm not sure where they are coming from but its definitely made when i create the file.

I thought i was creating the xml correctly but now im not so sure


I assume that this is being created at line 9 but im not sure.

C# Code:
  1. XmlDocument xmlDoc = new XmlDocument();
  2.             if (File.Exists(path))
  3.             {
  4.                 File.Delete(path);
  5.             }
  6.             //if file is not found, create a new xml file
  7.             XmlTextWriter xmlWriter = new XmlTextWriter(path, System.Text.Encoding.UTF8);
  8.             xmlWriter.Formatting = Formatting.Indented;
  9.             xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
  10.             xmlWriter.WriteStartElement("Root");
  11.  
  12.             xmlWriter.Close();
  13.             xmlDoc.Load(path);
  14.  
  15.             XmlNode root = xmlDoc.DocumentElement;
  16.  
  17.             XmlElement fileInfo = xmlDoc.CreateElement("FileInfo");
  18.             XmlElement MatchInfo = xmlDoc.CreateElement("MatchInfo");
  19.             XmlElement TeamInfo = xmlDoc.CreateElement("TeamInfo");
  20.  
  21.  
  22.             MatchInfo.SetAttribute("Headline", TB_Headline_o.Text);
  23.             MatchInfo.SetAttribute("R1Title", TB_R1_Title_o.Text);
  24.             MatchInfo.SetAttribute("R2Title", TB_R2_Title_o.Text);
  25.             MatchInfo.SetAttribute("R3Title", TB_R3_Title_o.Text);
  26.             MatchInfo.SetAttribute("R4Title", TB_R4_Title_o.Text);
  27.  
  28.             XmlElement TourName = xmlDoc.CreateElement("TourName");
  29.             XmlElement Username = xmlDoc.CreateElement("Username");
  30.             XmlElement Timestamp = xmlDoc.CreateElement("timestamp");
  31.             XmlElement Title = xmlDoc.CreateElement("Region");
  32.  
  33.  
  34.  
  35. (Cutting out alot of the middle stuff)
  36.  
  37.  
  38.  
  39.             root.AppendChild(fileInfo);
  40.             root.AppendChild(MatchInfo);
  41.             root.AppendChild(TeamInfo);
  42.             xmlDoc.Save(path);
  43.             MessageBox.Show("File Saved!");