private void CleanupAttributes(XmlSchemaObjectCollection attributes) { foreach (XmlSchemaObject obj in attributes) { if (obj is XmlSchemaAttribute) { CleanupAttribute((XmlSchemaAttribute)obj); } } }