1. A method of parsing and formatting a document encoded using a markup language, the structure of said document represented by a tree having one or more nodes, said method including the steps of: for a current one of said nodes, freeing memory occupied by any previously formatted one of said nodes upon which formatting of said current node, according to a set of formatting rules, is independent; and building a partial document tree using the current node and remaining previously formatted nodes upon which formatting of said current node, according to said set of formatting rules, is dependent.