private bool existXmlSchemaElement(XmlSchemaObjectCollection collection)
{
foreach (XmlSchemaObject obj in collection)
{
XmlSchemaElement element = obj as XmlSchemaElement;
if (element != null)
{
XmlSchemaComplexType type = element.ElementSchemaType as XmlSchemaComplexType;
if (type != null) return true;
}
}
return false;
}