Nitrogen-containing fused ring compounds of general formula (I) for use as CRTH2 antagonists, and pharmaceutically acceptable salts and stereoisomers thereof, where X1, X2, X3, X4, X5, W, X, Y, L1, L2, L3, A, and B are as defined in the specification. Methods for preparing compounds of general formula (I), drug formulations and pharmaceutical compositions containing the compounds, and uses of the compounds in preparation of drugs for treatment and/or prevention of diseases related to CRTH2 activity.