1. An apparatus comprising: one or more processors; and a computer readable storage medium having computer readable program code embodied therewith and executable by the one or more processors, the computer readable program code comprising: computer readable program code configured to accept an XML document stream; computer readable program code configured to apply a query twig to the XML document stream; computer readable program code configured to extract tuples from the XML document stream based on the query twig and, during streaming of the XML document stream, proactively limit a quantity of extracted tuples via foregoing: extraction of duplicate tuples; and extraction of tuples that do not satisfy query twig criteria; and computer readable program code configured to store, at a non-leaf node in the query twig, information about a child node, and to employ the information in the limiting a quantity of extracted tuples, wherein the information includes state information about the child node, the state information conveying information that relates to at least one node in the XML document stream; said computer readable program code being configured to pre-compute partial results during streaming of an XML document, wherein the XML document stream used to pre-compute partial results is not buffered towards computing a final result; said computer readable program code being configured to accept the XML document stream of a size that exceeds available memory.