A computerized system and method for transforming the results of a query
into a hierarchical information stream, such as an eXtensible Markup
Language (XML) data stream is disclosed. A database server receives a
query and generates a rowset. A rowset processor, using the mode
specified in the query, processes the rowset and query to generate the
XML data stream. For the "auto1" mode, the rowset processor transforms a
rowset into an XML data stream using primary-foreign key information
specified in the query to determine nesting. For the "auto2" mode, the
rowset processor transforms a rowset into an XML data stream using table
ordering information included in the query to determine nesting. For the
"explicit" mode, the rowset processor transforms a rowset into an XML
data stream using the explicit organizational information specified in
the query.