<p>I want to do this:  </p>

<blockquote>
  <p>//*fu</p>
</blockquote>

<p>which returns all nodes whose name ends in <strong>fu</strong>, such as <code>&lt;tarfu /&gt;</code> and <code>&lt;snafu /&gt;</code>, but not <code>&lt;fubar /&gt;</code></p>

[{'answer_id': 46141, 'author': 'Chris Marasti-Georg', 'author_id': 96, 'author_profile': 'https://Stackoverflow.com/users/96', 'pm_score': 6, 'selected': True, 'text': '<p>Do something like:</p>\n\n<pre><code>//*[ends-with(name(), \'fu\')]\n</code></pre>\n\n<p>For a good XPath reference, check out <a href="http://www.w3schools.com/xml/xsl_functions.asp" rel="noreferrer">W3Schools</a>.</p>\n'}, {'answer_id': 288865, 'author': 'Dimitre Novatchev', 'author_id': 36305, 'author_profile': 'https://Stackoverflow.com/users/36305', 'pm_score': 6, 'selected': False, 'text': '<p><strong>This answer is for <a href="http://www.w3.org/TR/xpath#section-String-Functions" rel="noreferrer">XPath 1.0</a></strong> where there is no equivalent of the <a href="http://www.w3.org/TR/xpath-functions/#func-ends-with" rel="noreferrer">XPath 2.0 standard ends-with() function</a>.</p>\n\n<p>The following XPath 1.0 expression selects all elements in the xml document, whose names end with the string "fu":</p>\n\n<pre><code>//*[substring(name(),string-length(name())-1) = \'fu\']\n</code></pre>\n'}, {'answer_id': 44435539, 'author': 'Identity1', 'author_id': 3741717, 'author_profile': 'https://Stackoverflow.com/users/3741717', 'pm_score': 2, 'selected': False, 'text': '<p>I struggled with Dimitre Novatchev\'s answer, it wouldn\'t return matches. I knew your XPath must have a section telling that "fu" has length 2. </p>\n\n<p>It\'s advised to have a string-length(\'fu\') to determine what to substring.</p>\n\n<p>For those who aren\'t able to get results with his answer and they require solution with xpath 1.0:</p>\n\n<p><code>//*[substring(name(), string-length(name()) - string-length(\'fu\') +1) = \'fu\']</code></p>\n\n<blockquote>\n  <p>Finds matches of elements ending with "fu"</p>\n</blockquote>\n\n<p>or</p>\n\n<p><code>//*[substring(name(), string-length(name()) - string-length(\'Position\') +1) = \'Position\']</code></p>\n\n<blockquote>\n  <p>Finds matches to elements ending with "Position"</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/46125', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']