internal XmlSchemaElement FindElement(XmlSchemaObjectCollection elements, string elementName)
{
foreach(XmlSchemaObject obj in elements)
{
XmlSchemaElement xse = obj as XmlSchemaElement;
if (xse != null && xse.RefName != null)
{
if (xse.Name == elementName)
{
return xse;
}
}
}
return null;
}