refactored xml/ccda/c32 to use less code