public static bool IsOverlappedClosingElement(string text)
{
if (text == null)
{
throw new ArgumentNullException("text");
}
// min is </x>: 4
if (text.Length <= 4)
return false;
if ((text[0] != '<') ||
(text[text.Length - 1] != '>') ||
(text[1] != '/'))
return false;
string name = text.Substring(2, text.Length - 3);
return CanOverlapElement(name);
}