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