XPath is a type of locator in Selenium that is used to locate a web element based on its XML path. XML denotes Extensible Markup Language, which is used for storing, organizing, and transporting arbitrary data. Much like HTML tags, XML stores data in a key-value pair. Since HTML and XML both are markup languages, XPath can be used for locating HTML elements on a webpage. The underlying principle of XPath is traversing between several elements across the entire webpage and allowing them to find an element with the reference of some other element. The single slash i.e. ‘/’ is used to create XPath with the absolute path, while the double slash i.e. ‘//’ is used for creating XPath with the relative path. In the absolute path, the created XPath will start selection from the document node or the start node. However, in the relative path, the created XPath can start selection from anywhere within the entire web document.