Disclosed are compound of formula (I) and pharmaceutically accepted salts and prodrugs thereof, wherein each of R1, R2, R3, R4, R5, R6, X1 and X2 is as defined in the description. These compounds are protein kinases inhibitors, especially the inhibitors of Mek, which are useful in the treatment of cancers and inflammation of mammals. Disclosed are the treatment methods of cancers and inflammation of mammals as well as pharmaceutical compositions comprising the compounds described herein. The preparation of benzoheterocyclic compounds are disclosed. Disclosed are the preparation of potential drug candidates, such as benzooxazol, benzothiazol, benzothiadiazol and the like.