do not write <text/> if id is blank

fixes http://manage.dimagi.com/default.asp?71744