code: public static function addPackages(stdClass $shipment, DOMNode $node)
      {
          foreach ($shipment->Package as $package) {
              $packageNode = $node->appendChild($node->ownerDocument->createElement('Package'));
  
              if (isset($package->PackagingType)) {
                  $packagingType = $packageNode->appendChild($node->ownerDocument->createElement('PackagingType'));
                  self::appendChild($package->PackagingType, 'Code', $packagingType);
                  self::appendChild($package->PackagingType, 'Description', $packagingType);
              }
  
              $pwNode = $packageNode->appendChild($node->ownerDocument->createElement('PackageWeight'));
  
              if (isset($package->PackageWeight)) {
                  self::appendChild($package->PackageWeight, 'Weight', $pwNode);
                  if (isset($package->PackageWeight->UnitOfMeasurement)) {
                      // Add the UnitOfMeasurement children nodes Code and Description
                      self::appendChild($package->PackageWeight->UnitOfMeasurement, 'Code', $pwNode);
                      self::appendChild($package->PackageWeight->UnitOfMeasurement, 'Description', $pwNode);
                  }
              }
          }
      }
docs: @param stdClass $shipment
  @param DOMNode $node
  
  @deprecated Use NodeInterface on entities instead