string selectedFile = richTextBox1.Text;
XmlDocument doc = new XmlDocument();
doc.Load(selectedFile);
You are getting the file name from the RichText control and that contains an invalid file name.
I don't know which file name you want to use but it looks like you need to store the selected file name somewhere to use that instead of the file content loaded into the RichText box.