When overridden in a derived class, writes the specified start tag and associates it with the given namespace.
Type Reason InvalidOperationException The XmlWriter.WriteState is WriteState.Closed.
After calling this method you can either write attributes, or create content using XmlWriter.WriteComment(string), XmlWriter.WriteString(string), or WriteStartElement for child elements. You can close the element with either XmlWriter.WriteEndElement or XmlWriter.WriteFullEndElement. For example, the following C# code:
Example
writer.WriteStartElement("item",null); writer.WriteString("some text"); writer.WriteEndElement();
Generates the following output:
Example
<item>some text</item>
For the asynchronous version of this method, see XmlWriter.WriteStartElementAsync(string, string).