Code rewrite for new requirements.
xml documents now generated using JAXB.