The walls of xylem cells are lignified (strengthened with a substance called lignin ). This allows the xylem to withstand pressure changes as water moves through the plant.
The cell membrane is flexible because of the presence of oil like substances called phospholipids, which gives it a fluid nature. While as the cell walls are rigid because of the presence of the thick layers of the substances like cellulose in plants, chitin in fungi and peptidoglycon in bacteria.