Patent ID: 7730048

Claim:
A method for generating a hierarchical data stream, comprising: receiving a query at a parser, the query including at least one database statement utilized by a query processor that retrieves at least one rowset from a database, the query also including mode information, wherein the parser extracts the mode information from the query during parsing; processing the query at the query processor to retrieve the at least one rowset from the database; and transforming at a rowset to hierarchical processor a rowset of the at least one rowset into a datatype instance of a hierarchical language of the hierarchical data stream by mapping each row element of a rowset of the at least one rowset into an element of the hierarchical data stream based on the mode information received by the rowset to hierarchical processor from the parser, wherein the mode information includes a first mode in which the processor transforms the rowset into a nested tree that defines the hierarchical data stream based on, at least in part, mapping table information included in the query to one or more elements of the hierarchical data stream as a function of primary-foreign key relationships identified in the table information, wherein receiving includes receiving a query including at least one valid database statement used to retrieve at least one rowset from a database and at least one of a name option parameter, a root option parameter, a map option parameter, one or more namespace option parameters and a null option parameter; wherein receiving includes receiving a query including at least one valid database statement used to retrieve at least one rowset from a database and a name option parameter, wherein transforming includes overwriting a name of a row element based on the name of the option parameter; and wherein if the name option parameter is specified to be a predetermined value, then the transforming includes dropping a tag of the row element and any continued attribute.