and stereoisomers and pharmaceutically acceptable salts or solvates thereof, in which A, B, X1, X2, X3, X4, Ring D, and E have the meanings given in the specification, which are inhibitors of RET kinase and are useful in the treatment and prevention of diseases which can be treated with a RET kinase inhibitor, including RET-associated diseases and disorders.