1. A computer program product on a computer-readable medium containing a plurality of executable program instructions for versioning records of XML sub-documents in a database, the instructions for: representing node identifiers and version numbers in two-dimensional space along with record boundaries; adding virtual record boundaries to said record boundaries and dividing said dimensional space into a series of rectangles, said virtual record boundaries added to support multiple versions of said sub-documents; and building a search tree index comprising index points corresponding to a bottom corner points of each of said rectangles being any of a close rectangle if respective upper corners are known or an open rectangle, each of said index points comprising a triple of node identifier, version number and record identifier.