I am using C# and XDcoument to add nodes the root element. I use this code:
XElement miAnimalNuevo = new XElement("PrincipalNode",
new XAttribute("Atribute1", "value attribute 1"),
new XAttribute("Attribute2", "value attribute 2"),
new XElement("subNode","0000"));
But I get this:
<PrincipalNode Atribute1="value attribute 1" Attribute2="value attribute 2" xmlns="">
<subNode>0000</subNode>
</PrincipalNode>
After the attribute 2, I see the xmlns="". Why? I only want the attributes.
Thanks.