public override void ReadEndElement()
{
if (_node.NodeType != XmlNodeType.EndElement && MoveToContent() != XmlNodeType.EndElement)
{
int nodeDepth = _node.NodeType == XmlNodeType.Element ? _depth - 1 : _depth;
if (nodeDepth == 0)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.XmlEndElementNoOpenNodes)));
// If depth is non-zero, then the document isn't what was expected
XmlElementNode elementNode = _elementNodes[nodeDepth];
XmlExceptionHelper.ThrowEndElementExpected(this, elementNode.LocalName.GetString(), elementNode.Namespace.Uri.GetString());
}
Read();
}