Current position in the document tree is called the current node. Current node's XPath may be queried with pwd command. In the interactive shell, current node is also displayed in the command line prompt. Remember, that beside cd command, current node (and document) is silently changed by all variant of open command, create command and temporarily also by the node-list variant of the foreach statement.
Documents are specified in a similar way as harddrives on DOS/Windows(TM) systems (except that their names are not limitted to one letter in XSH), i.e. by a prefix of the form doc: where doc is the id associated with the document.
xsh scratch:/> open docA="testA.xml" xsh docB:/> open docB="testB.xml" xsh> pwd docB:/ xsh docB:/> cd docA:/article/chapter[title='Conclusion'] xsh docA:/article/chapter> pwd docA:/article/chapter xsh docA:/article/chapter> cd previous-sibling::chapter xsh docA:/article/chapter> cd .. xsh docA:/article> select docB xsh docB:/>