public static function removeNonDisplayValues(Node $node) {
    $displayValues = $node->getProperty('displayValues');
    $valueNames = $node->getValueNames();
    foreach($valueNames as $name) {
      if (!in_array($name, $displayValues)) {
        $node->removeValue($name);
      }
    }
  }