fix ID/IDREF handling