title: XPath expression to find elements whose tag name contains 'Name'
body: <p>I am a newcomer to XPath.</p>
  
  <p>I am looking for a way to get all elements whose tag name contains a particular string.</p>
  
  <p>For example, if I have XML like below, I want to get all the elements whose tag name contains the word 'Name'. i.e., I want to fetch the following elements: <code>&lt;SquareName&gt;</code>, <code>&lt;RectangleName&gt;</code>, and <code>&lt;ParallelogramName&gt;</code>.</p>
  
  <p>I tried some combinations of <code>name()</code>, <code>contains()</code> etc., but it did not work.
  Please suggest.</p>
  
  <pre><code>&lt;Objects&gt;
   &lt;Four-Sided&gt;
     &lt;Square&gt;
        &lt;SquareName&gt;ABCD&lt;/SquareName&gt;
        &lt;Length&gt;4&lt;/Length&gt;
        &lt;Height&gt;4&lt;/Height&gt;
        &lt;Colour&gt;Blue&lt;/Colour&gt;
     &lt;/Square&gt;
     &lt;Rectangle&gt;
        &lt;RectangleName&gt;EFGH&lt;/RectangleName&gt;
        &lt;Length&gt;10&lt;/Length&gt;
        &lt;Height&gt;6&lt;/Height&gt;
        &lt;Colour&gt;Brown&lt;/Colour&gt;
     &lt;/Rectangle&gt;
     &lt;Parallelogram&gt;
        &lt;ParallelogramName&gt;WXYZ&lt;/ParallelogramName&gt;
        &lt;Length&gt;12&lt;/Length&gt;
        &lt;Height&gt;4&lt;/Height&gt;
        &lt;Colour&gt;Black&lt;/Colour&gt;
     &lt;/Parallelogram&gt;
  &lt;/Four-Sided&gt;
  &lt;/Objects&gt;
  </code></pre>