public override void WriteStartElement(string prefix, string localName, string ns) {
Debug.Assert(prefix != null && localName != null && localName.Length != 0 && ns != null, "Invalid argument");
Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Element, ValidateNames.Flags.All), "Name validation failed");
// Xml state transitions
ConstructWithinContent(XPathNodeType.Element);
// Call XmlRawWriter.WriteStartElement
WriteStartElementUnchecked(prefix, localName, ns);
// Ensure that element's namespace declaration is declared
WriteNamespaceDeclarationUnchecked(prefix, ns);
// Cache attributes in order to detect duplicates
if (this.attrCache == null)
this.attrCache = new XmlAttributeCache();
this.attrCache.Init(Writer);
Writer = this.attrCache;
this.attrCache = null;
// Push element names onto a stack
PushElementNames(prefix, localName, ns);
}