Notes Form to XML Schema

This may be a very simple question but I am drawing a blank at the moment.

How does one convert a Lotus Notes form to a XML Schema?

I am looking for a way to do this via Java or Lotusscript.

Subject: I guess you could start by exporting the form to DXL…

…and then use XSLT to filter out and generate just the schema you want based on the fields in the form.