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 Extensible Markup Language (XML) document stream; computer readable program code for applying a query twig to the XML document stream; computer readable program code for extracting tuples from the XML document stream based on the query twig; computer readable program code for limiting a quantity of extracted tuples via foregoing: extraction of duplicate tuples; and extraction of tuples that do not satisfy query twig criteria.