protected function shouldPreserveWhitespace($textNode) { $spaceValue = $textNode->getAttribute('space', 'xml'); return $spaceValue === 'preserve'; }