public void WriteEndNamespace() {
Debug.Assert(this.xstate == XmlState.WithinNmsp, "WriteEndNamespace cannot be called in the " + this.xstate + " state.");
this.xstate = XmlState.EnumAttrs;
this.depth--;
// Write cached namespace attribute
WriteNamespaceDeclaration(this.nmspPrefix, this.nmspText);
this.nmspPrefix = null;
if (this.depth == 0)
EndTree();
}