refactored to make compatible with gnat2xml v7.3.0w