rearrange error checking
remove XML support.