Chameleon has extensive capabilities in converting between traditional HL7 formats and XML. Using these APIs is quite simple from Java. The process involves:
A small example program can be generated from the New Project dialog called 'XML'.