You'll want to issue a WriteAttributeString
:
myXmlTextWriter.WriteAttributeString(null, "nr", null, "401");
myXmlTextWriter.WriteEndElement();
and do that right after the WriteStartElement
.
You could probably use this overload too:
myXmlTextWriter.WriteAttributeString("nr", "401");
and of course replicate that for all other attributes. And it would work the same for the child node as well.