title: How to use xpath to select elements by xsd type in instance document?
body: <p>For example:
  My xsd is:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;
      &lt;xs:element name="Zoo"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence maxOccurs="unbounded"&gt;
                  &lt;xs:element ref="Animal"/&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
      &lt;xs:element abstract="true" name="Animal"/&gt;
      &lt;xs:element name="Tiger" substitutionGroup="Animal" type="Tiger"/&gt;
      &lt;xs:element name="Wolf" substitutionGroup="Animal" type="Wolf"/&gt;
      &lt;xs:complexType name="Animal"&gt;
          &lt;xs:attribute name="name"/&gt;
      &lt;/xs:complexType&gt;
      &lt;xs:complexType name="Tiger"&gt;
          &lt;xs:complexContent&gt;
              &lt;xs:extension base="Animal"/&gt;
          &lt;/xs:complexContent&gt;
      &lt;/xs:complexType&gt;
      &lt;xs:complexType name="Wolf"&gt;
          &lt;xs:complexContent&gt;
              &lt;xs:extension base="Animal"/&gt;
          &lt;/xs:complexContent&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  
  
  <p>My instance document is:</p>
  
  <pre><code>&lt;Zoo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Zoo.xsd"&gt;
      &lt;Tiger name="001"/&gt;
      &lt;Wolf name="002"/&gt;
      &lt;Wolf name="003"/&gt;
  &lt;/Zoo&gt;
  </code></pre>
  
  <p>How to use xpath to select all elements whose complex type is Animal?
  Can xpath be able to use xsd meta information?</p>