W3C specifications can at times be intimidating, but you might want to check out the following for reference:
q XPath 2.0 specification- This contains everything about the syntax and semantic of the language. You can find it at http://www.w3.org/TR/xpath20/.
q XPath 2.0 and XQuery 1.0 Functions and Operators specification- One of the great benefits of XPath 2.0 compared to XPath 1.0 is its extensive function library. This library includes everything you need to deal with strings and dates. You can find it at http://www.w3.org/TR/xpath-functions/.
q XPath 1.0 specification- Given the choice between using XPath 1.0 and 2.0, you should go with XPath 2.0. But if you have to work with XPath 1.0, then the XPath 1.0 specification is your reference. You can find it at http://www.w3.org/TR/xpath.