What am I doing wrong here?
var ns = XNamespace.Xmlns + "guid";
var doc = new XDocument(
new XElement("root",
new XAttribute(ns, "Guid"),
new XElement(ns + "MyValue", "{4258b6f1-2c60-4723-8d99-a458d05104b6}")));
// doc.ToString() throws an exception: Prefix "xmlns" is reserved for use by XML.
This is what I want to achieve:
<?xml version="1.0" ?>
<root xmlns:guid="Guid">
<guid:MyValue>4258b6f1-2c60-4723-8d99-a458d05104b6</guid:MyValue>
</root>