Think of a living treetrunk not as a solid thing, but as a hollow cylinder of growing plant material just under the bark.
This living part grows in two directions. The outside layer grows outwards, and becomes the bark -- which is dead. The inside layer grows xylem vessels on its inside.
As these build up on the inside, they push the living layer outwards. When the living layer has moved away, they die, and are left as non-living, but of course functional water transport tubes, or as we usually call it, wood.
The growing layer is called the cambium. The reason why many trees have fissured bark is because it is always having to expand.
All this is why completely hollow trees can live perfectly well -- some for hundreds of years -- they only need a layer of xylem under the bark, not the whole tree trunk.