private void PopElement(int idx, XMLListener l) { if (l != null) { l.EndElement(idx, this.topElement); } this.stack.Pop(); if (stack.Count > 0) { this.topElement = (this.stack.Peek()); } else { this.topElement = null; } }