Write xmlns element with attributes
问题 I'm using XmlWriter to generate an XML file. I am trying to replicate an old XML file and I want to create an entry that will look like; <Return xmlns="http://address/here" appName="Data Return - Collection Tool" appVer="1.1.0"> My code is as follows: writer.WriteStartElement("Return", "http://address/here") writer.WriteAttributeString("appName", "Data Return - Collection Tool") writer.WriteAttributeString("appVer", "1.1.0") This is generating the attributes in the wrong order ie. <Return