A method for publishing relational data as XML by translating XML queries into
queries against an relational database. Conversion of the relational database into
an XML database is not required. Each relational table is mapped to a virtual XML
document, and XML queries are issued over these virtual documents. An XML query
is parsed and transformed into a language-neutral intermediate representation,
which is a sequence of operations describing how the output document is derived
from the underlying relational tables. The intermediate representation is then
translated into an SQL query over the underlying relational tables and into instructions
for a tagger. The SQL query is executed, and the SQL query results are then fed
into the tagger, which follows tagger instructions to generate the marked up output.