XPath
You need to fix XPath manually for tags /svg and after it (i.e. /path, /g) as follows:
.../svg => .../*[name()='svg']
.../path => .../*[name()='path']
If an element contains an index, then index should go right after replaced tag, i.e.:
.../svg[3] => .../*[name()='svg'][3]
If an element contains a selector, then selector should be merged using 'and':
.../path[@d="M150 0 L75 200 L225 200 Z"] => .../*[name()='path' and @d="M150 0 L75 200 L225 200 Z"]
For example, here: https://www.w3schools.com/graphics/svg_path.asp we have an XPath learned automatically that ends like that:
/html/body/div[@id='belowtopnav']/div[1]/div[@id='main']/svg[1]/path
The fix for it to work properly is following:
/html/body/div[@id='belowtopnav']/div[1]/div[@id='main']/*[name()='svg'][1]/*[name()='path']
CSS
There is also a way to query svg elements using CSS.
html > body > div[id='belowtopnav'] > div > div[id='main'] > svg[height='210'] > path
or just
svg[height='210'] > path