Moved the XPath of the id selector to the NamedSelector

As announced in #522, I extracted this change from #427 to apply it in 1.x