Both XPath and CSS selectors are arbitrary. There is no good answer for this in the general case.
Selecting the first c in <a><b></b><c></c><c></c></a> with a CSS selector might be c:first-of-type, or a > c:nth-child(2), or a c:first-of-type, or a > b + c, or a number of other things. Similarly as an XPath there are many ways of representing it. If you change the markup, what should happen?
It all depends upon the context, the stability required, whether false positives or false negatives are worse (you can make it very strict so that if the markup changes it will probably break, or you can make it very loose so that if the markup changes you may well select the wrong thing) and the whim of the person doing it. (Which of the ways above will I select? Eeny, meeny, miny, mo...)
If, however, you only care about the current state of a document and have no need for resilience, first of all consider if you actually need to have such a selector. You can probably pass the DOM element around instead. If you want to uniquely identify an element, though, following through the DOM tree is going to be a fairly straightforward way, travelling down level by level, observing which child the node is. You'll end up with something like this:
:root > :nth-child(3) > :nth-child(1) > :nth-child(4)
Ugly, but it may be what you want.