I would like to bring to your notice one thing which i missed out telling before that the only FITS data which im encoding in XML is the only the ASCII header part and not the entire FITS file. So its like im dealing with ASCII data of Fits file only.