How might I create a function that converts between `FullForm` and a XML structuce?

Ultimately I'm ideally looking to use CSS and JS to edited the XML structure.

For example using jquery I might do something like `$('Times Power')`.

Ideally I'm looking for the following code to export the following xml.

 Times[a, Rational[1, -2], "test"]

to

 <Times>
 <Symbol>a</Symbol>
 <Rational>
 <Integer>1</Integer>
 <Integer>-2</Integer>
 </Rational>
 <String>test</String>
 </Times>
</Times>