1. A method for generating a representation of a document from eXtensible Markup Language (XML) code describing the document, comprising: executing by a processor the following steps: substitution-processing the XML code describing the document to generate substitution-processed XML code, comprising: identifying, within the XML code describing the document, a conditional logic portion that comprises an expression and data; determining a Boolean value of the expression; modifying, if the determined value is “true,” the XML code describing the document by replacing the conditional logic portion with the data; and modifying, if the determined value is “false,” the XML code describing the document by removing the conditional logic portion; composition-processing the substitution-processed XML code to generate composition-processed XML code, comprising: identifying, within the substitution-processed XML code, content that is to be flowed; identifying, within the substitution-processed XML code, a template through which the identified content is to be flowed; determining whether the identified content fits within one instance of the identified template; and modifying, if the identified content does not fit within one page of the identified template, the substitution-processed XML code in order to specify an additional instance of the identified template; imposition-processing the composition-processed XML code to generate imposition-processed XML code, wherein imposition-processing comprises: identifying a code portion within the composition-processed XML code that is specified as being a logical page; identifying a requested physical page size that represents a physical sheet of material; and modifying the composition-processed XML code in order to implement the requested physical page size by specifying one or more physical pages, wherein a physical page includes multiple logical pages, and wherein modifying the composition-processed XML code comprises changing a position of a <page> tag within the composition-processed XML code; and generating, based on the imposition-processed XML code, the representation of the document using a page description language.