1. A method comprising: providing a non-active representation of a document, the non-active representation of the document comprising a piece descriptor and a piece descriptor index; executing, by a computing system, a builder thread to input or modify an element in the document, the builder thread creating a new piece descriptor for indicating a position where the element belongs in the document, the new piece descriptor and the piece descriptor index forming an active representation of the document, wherein the active representation of the document and the non-active representation of the document refer to the same data stored in memory; providing access to the non-active representation for use by a reader thread while the builder thread modifies the active representation of the document; after the builder thread modifies the document, updating the non-active representation of the document with the active representation of the document, such that modifications to the element at the position indicated by the new piece descriptor replaces a corresponding element at the position indicated by the piece descriptor in the non-active representation of the document; and after updating the non-active representation, providing access to the non-active representation of the document including the modifications to the element.