The base-uri() Function

This function evaluates the base URL in the context of the current node. It does not have any arguments and takes into account the xml:base context of the current node. See the XML Base specification for more details.