What's the best way to generate XML schemas?

I have a class in buildSrc that will take a class name and generate an XML schema file using JAXB from a class that has JAXB annotations. This needs to run after the java code has been compiled already.

Thanks! Sean