I try to write a litte plugin for Visual studio for XML code documenation. But my code that creates the XML is not working correctly:
XElement rootElement = new XElement("doc");
XElement summaryElement = new XElement("summary");
var refElement = new XElement("see");
refElement.Add(new XAttribute("cref", codeFunction.Name));
summaryElement.Value = string.Format("Initializes a new instance of the {0} class.", seeRefElement);
rootElement.Add(summaryElement);
comment = rootElement.ToString();
This is the output.
<doc>\r\n <summary>Initializes a new instance of the <see cref="Form1" /> class.</summary>\r\n</doc>
It should be:
<doc>\r\n <summary>Initializes a new instance of the <see cref="Form1" />class.</summary>\r\n</doc>
Should I use another way to create my XML?Any hints and improvments are appreciated.