1. You have to make ODBC connection to your SD database 2. You have to create ini-file as configuration for Export. 3. You have to run Export
You can find example of ini-file in your ...\client\DataExchange\Config dir (SD 4.5). For example sd_lang.ini (if you have one of the latest SPs or if you have installed localization this file must exist). For example here is my file in attach. See also Data exchange guide (http://ovweb.external.hp.com/lpe/doc_serv/?sdesk).
You could also use the Web API to write Java and you can get libraries to turn objects into XML for Java. The Web API is poor for large data grabs SQL is much better. Does Oracle allow an SQL query to return XML?