instead of looking for a closing <unittitle>, use </did> to insert the unitid