def _filter_xpath_grouping(xpath):
<EOL>xpath = xpath[<NUM_LIT:1>:]<EOL>index = xpath.rfind('<STR_LIT:)>')<EOL>if index == -<NUM_LIT:1>:<EOL><INDENT>raise XpathException("<STR_LIT>" % xpath)<EOL><DEDENT>xpath = xpath[:index] + xpath[index + <NUM_LIT:1>:]<EOL>return xpath<EOL>
This method removes the outer parentheses for xpath grouping.
The xpath converter will break otherwise.
Example:
"(//button[@type='submit'])[1]" becomes "//button[@type='submit'][1]"