Tagging trees are generated and used to facilitate transforming data from
relational databases into hierarchical formats, such as in XML documents.
Tagging trees contain both XML hierarchical structure information as well
a query information that is needed to access different data sources,
e.g., databases, to retrieve the information to be placed in the
hierarchical structure. A designer optionally creates a mapping script
that specifies the transformation from relational databases to the
hierarchical format. A tagging tree is created by either parsing that
mapping script or by other means. A runtime environment then processes
the tagging tree by a depth first traversal. The runtime environment is
able to be configured to output a hierarchical data object, such as an
XML document, or pipelined to control, for example, SAX processing.