key points are:
1) XSD file itself xml document.
2) xml files can be queried with xpath - in C# it could be done with SelectNodes method of xml doc.
SelectNodes("//somenode", nsmgr);
3)As you see SelectNodes has nsmgr parameter. (XmlNamespaceManager nsmgr)
If you want to query xsd which is in xs: namespace, you have to add it:
nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
4) dirty xpath to get all xs:elements with type attributes set is:
//xs:element[@type]
http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.selectnodes.aspx[
^]
http://msdn.microsoft.com/ru-ru/library/system.xml.xmlnamespacemanager.addnamespace(v=vs.95).aspx[
^]