Shared and/or interactive contents such as office documents and wiki contents are often provided with both the latest version and all past versions. It is necessary to add version axes to XPath in order to trace version histories of fine-grained subdocuments of XML. Although research has been done on the containment and equivalence problems for XPath, which is a basic property of optimizing queries, there has been no research in the case for XPath extended with version axes. In this paper, we will propose query rewriting rules which can exchange between document axes and version axes, and prove that they are preserving query semantics. The rewriting rules enable us to swap path subexpressions between document axes and version axes to optimize queries.