Denedim:XDocument için bir xmlns nasıl belirlenir?
textBox1.Text = new XDocument(new XDeclaration("1.0", "UTF-8", "yes"),
new XElement("root1", new XAttribute("xmlns", @"http://example.com"), new XElement("a", "b"))
).ToString();
Ama olsun: (buldum bir cevap uygun)
The prefix '' cannot be redefined from '' to 'http://example.com' within the same start element tag.
Ben de ikame çalıştı:
XAttribute(XNamespace.Xmlns,...
Ama aynı zamanda bir hata var.
Not Not: Bu belgede birden fazla xmlns bulundurmaya çalışmıyorum.
Belki bu sizin için çalışır: http://stackoverflow.com/a/2874572/1373170 –