Use the XPath axes parent, ancestor, preceding-sibling, following-sibling. For example, if the context node is within a chapter element, you can find the chapter as ancestor::chapter.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference