add media, lots of xhtml fixup