About this, sure, it should be done in BrowserContext since it will form XPath for XML / XHTML.

My original idea was to use this also for Rest API for XML, however don't think its possible to use XPath on JSON, so it would have to be re-done for JSON, so if it needs to be re-done for JSON, it's better to implement a way to test both in the same way.

Being like that it should be moved to  BrowserContext