Generates $value into a serialized representation.

@param \XmlWriter $writer
@param mixed $value
@param string|null $key
@param string $elementName
762085
protected function generateValue(\XmlWriter $writer, $value, $key = null, $elementName = 'value')
    {
        switch (($hashValueType = gettype($value))) {
            case 'NULL':
                $this->generateNullValue($writer, $key, $elementName);
                break;

            case 'boolean':
                $this->generateBooleanValue($writer, $value, $key, $elementName);
                break;

            case 'integer':
                $this->generateIntegerValue($writer, $value, $key, $elementName);
                break;

            case 'double':
                $this->generateFloatValue($writer, $value, $key, $elementName);
                break;

            case 'string':
                $this->generateStringValue($writer, $value, $key, $elementName);
                break;

            case 'array':
                $this->generateArrayValue($writer, $value, $key, $elementName);
                break;

            default:
                throw new \Exception('Invalid type in field value hash: ' . $hashValueType);
        }
    }
1273434
function xmlSerialize(Writer $writer) {
        $writer->write([
            Schema::CBC . 'ID' => $this->id,
            [
                'name' => Schema::CBC . 'InvoicedQuantity',
                'value' => $this->invoicedQuantity,
                'attributes' => [
                    'unitCode' => $this->unitCode
                ]
            ],
            [
                'name' => Schema::CBC . 'LineExtensionAmount',
                'value' => number_format($this->lineExtensionAmount, 2, '.', ''),
                'attributes' => [
                    'currencyID' => Generator::$currencyID
                ]
            ],
            Schema::CAC . 'TaxTotal' => $this->taxTotal,
            Schema::CAC . 'Item' => $this->item,
        ]);

        if ($this->price !== null) {
            $writer->write(
                [
                    Schema::CAC . 'Price' => $this->price
                ]
            );
        }
    }
79047
protected function addNode(DOMElement $element, $key, $value): void
    {
        $key   = \str_replace(' ', '-', $key);
        $child = $this->element($key);
        $element->appendChild($child);
        $this->convert($child, $value);
    }
888504
protected function xmlSerializeValue(Xml\Writer $writer)
    {
        $writer->startElement(strtolower($this->getValueType()));
        $value = $this->getJsonValue();
        $writer->writeElement('start', $value[0][0]);

        if ('P' === $value[0][1][0]) {
            $writer->writeElement('duration', $value[0][1]);
        } else {
            $writer->writeElement('end', $value[0][1]);
        }

        $writer->endElement();
    }
309207
@Override
    public void xmlWriteOn(FormattedWriter writer) throws IOException
    {
        writer.startTag(XML_MESSAGE_STORE);
        writer.indent();
        synchronized (_startLock)
        {
            if (_state == MessageStoreState.STATE_STARTED)
            {
                _rootMembership.xmlWriteItemStreamsOn(writer);
            }
            else
            {
                writer.newLine();
                writer.write(XML_CANNOT_BE_WRITTEN);
            }
        }

        if (null != _itemStorageManager)
        {
            _itemStorageManager.xmlWriteOn(writer);
        }

        if (null != _membershipMap)
        {
            _membershipMap.xmlWriteOn(writer);
        }

        if (null != _persistentMessageStore)
        {
            _persistentMessageStore.xmlWriteOn(writer);
        }

        if (null != _expirer)
        {
            _expirer.xmlWriteOn(writer);
        }

        if (null != _cacheLoader)
        {
            _cacheLoader.xmlWriteOn(writer);
        }

        if (null != _deliveryDelayManager) {
            _deliveryDelayManager.xmlWriteOn(writer);
        }
        writer.outdent();
        writer.newLine();
        writer.endTag(XML_MESSAGE_STORE);
    }
381649
function xmlSerialize(Writer $writer) {
        // TODO: Implement xmlSerialize() method.
        $cbc = '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}';
        $cac = '{urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2}';

        $writer->write([
            Schema::CBC.'StreetName' => $this->streetName,
            Schema::CBC.'BuildingNumber' => $this->buildingNumber,
            Schema::CBC.'CityName' => $this->cityName,
            Schema::CBC.'PostalZone' => $this->postalZone,
            Schema::CAC.'Country' => $this->country,
        ]);
    }
603157
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    super.xmlWriteOn(writer);
    
    writer.newLine();
    writer.taggedValue("subscriberID", _subState.getSubscriberID());

    writer.newLine();
    writer.startTag("topics");
    writer.indent();

    String[] topics = _subState.getTopics();

    if (topics != null)
    {
      for (int i = 0; i < topics.length; i++)
      {
        writer.newLine();
        writer.taggedValue("topic", topics[i]);
      }
    }

    writer.outdent();
    writer.newLine();
    writer.endTag("topics");
    writer.newLine();
    writer.taggedValue("toBeDeleted", toBeDeleted);
  }
1289855
protected function xmlSerializeValue(Xml\Writer $writer)
    {
        // xCard is the only XML and JSON format that has the same date and time
        // format than vCard.
        $valueType = strtolower($this->getValueType());
        $writer->writeElement($valueType, $this->getValue());
    }
1057267
protected function serializeValue($elementName, Generator $generator, FieldType $fieldType, $value)
    {
        $hash = $fieldType->toHash($value);

        $fieldTypeIdentifier = $fieldType->getFieldTypeIdentifier();
        if ($this->fieldTypeProcessorRegistry->hasProcessor($fieldTypeIdentifier)) {
            $processor = $this->fieldTypeProcessorRegistry->getProcessor($fieldTypeIdentifier);
            $hash = $processor->postProcessValueHash($hash);
        }

        $this->serializeHash($elementName, $generator, $hash);
    }
1208301
public function writeXml(\XMLWriter $xmlWriter)
    {
        $xmlWriter->startElementNS(
            'atom',
            Resources::LINK,
            Resources::ATOM_NAMESPACE
        );
        $this->writeInnerXml($xmlWriter);
        $xmlWriter->endElement();
    }
225791
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("remoteMEUuid", remoteMEUuid);
    writer.newLine();
    writer.taggedValue("streamID", streamID);
    writer.newLine();
    writer.taggedValue("initialData", initialData);
    writer.newLine();
    writer.taggedValue("type", type);
  }
572173
protected static function xmlWrite( XMLWriter $xml, $hash, $childName = 'child' )
    {
        foreach( $hash as $key => $value )
        {
            if( is_array( $value ) )
            {
               if ( is_numeric( $key ) )
                   $xml->startElement( $childName );
               else
                   $xml->startElement( $key );
                self::xmlWrite( $xml, $value );
                $xml->endElement();
                continue;
            }
            if ( is_numeric( $key ) )
            {
                $xml->writeElement( $childName, $value );
            }
            else
            {
                $xml->writeElement( $key, $value );
            }
        }
    }
268535
function xmlSerialize(Writer $writer) {
        $this->validate();

        $writer->write([
                [
                    'name' => Schema::CBC . 'TaxableAmount',
                    'value' => number_format($this->taxableAmount, 2, '.', ''),
                    'attributes' => [
                        'currencyID' => Generator::$currencyID
                    ]

                ],
                [
                    'name' => Schema::CBC . 'TaxAmount',
                    'value' => number_format($this->taxAmount, 2, '.', ''),
                    'attributes' => [
                        'currencyID' => Generator::$currencyID
                    ]

                ],
                Schema::CAC.'TaxCategory' => $this->taxCategory
            ]
        );
    }
786806
public function writeXML( \XMLWriter $w, string $elementName = 'ImageSizeReducer' )
   {

      $w->startElement( $elementName );
      $this->writeXMLAttributes( $w );
      $w->endElement();

   }
28432
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("streamId", _streamId);
    writer.taggedValue("streamKey", _streamKey);
  }
837927
public function writeXml($xmlWriter)
    {
        $xmlWriter->startElementNS(
            'atom',
            Resources::CATEGORY,
            Resources::ATOM_NAMESPACE
        );

        $this->writeOptionalAttribute(
            $xmlWriter,
            'uri',
            $this->uri
        );

        $this->writeOptionalAttribute(
            $xmlWriter,
            'version',
            $this->version
        );

        $xmlWriter->writeRaw($this->text);
        $xmlWriter->endElement();
    }
1354652
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
      writer.newLine();
      writer.taggedValue("remoteMEId", remoteMEId);
      writer.newLine();
      writer.taggedValue("streamId", streamId);
      writer.newLine();
      writer.taggedValue("gatheringTargetDestUuid", gatheringTargetDestUuid);
  }