Returning data from JAVA in XML format



I need to bring records in a table to Flex application to
display in a dataGrid. I am using data services and a Java adapter
to query the data from the database and return as a Collection of
Value Objects. This part is working fine. However I have a need to
send the records in XML format to the UI. If I send each record as
org.w3c.dom.Element instead as a ValueObject?

Appreciate any help in this regard.