Im having trouble generating XML along the lines of this:
<Root xmlns:brk="http://somewhere">
<child1>
<brk:node1>123456</brk:node1>
<brk:node2>500000000</brk:node2>
</child1>
</Root>
This code get me most of the way but I cant get the 'brk' namespace infront of the nodes;
var rootNode = new XElement("Root");
rootNode.Add(new XAttribute(XNamespace.Xmlns + "brk", "http://somewhere"));
var childNode = new XElement("child1");
childNode.Add(new XElement("node1",123456));
rootNode.Add(childNode);
Iv tried this:
XNamespace brk = "http://somewhere";
childNode.Add(new XElement(brk+"node1",123456));
and this
XNamespace brk = "http://somewhere";
childNode.Add(new XElement("brk:node1",123456));
but both cause exceptions.