A method of parsing a markup-language document includes detecting, in a markup-language document, a start of a first data node of a first node type and identifying a first data definition associated with the first node type. The method further includes adding a first entry associated with the first data node to a data structure and reading contents of the first data node. Additionally, the method includes determining an acceptance status of the first data node based on the first data definition. Furthermore, the method also includes identifying an end of the first data node based on the acceptance status of the first data node and, in response to identifying the end of the first data node, removing the first entry from the data structure.