It should be enough to cast to the right base class.
Everything that descends from FrameworkElement
has a Name property.
foreach(object child in tab.Children)
{
string childname = null;
if (child is FrameworkElement )
{
childname = (child as FrameworkElement).Name;
}
if (childname != null)
...
}