added generation of xhtm content and header, made mets configurable, code simplification