An XANES study of carbides of molybdenum and tungsten