Generate XML for copy field definitions

@return string
512497
public function getCopyFieldDefinitions()
    {
        $xml = array();

        // Default copy fields
        foreach ($this->getCopyDestinations() as $copyTo) {
            foreach ($this->fulltextFields as $name => $field) {
                $xml[] = "<copyField source='{$name}' dest='{$copyTo}' />";
            }
        }

        // Explicit copy fields
        foreach ($this->copyFields as $source => $fields) {
            foreach ($fields as $fieldAttrs) {
                $xml[] = $this->toXmlTag('copyField', $fieldAttrs);
            }
        }

        return implode("\n\t", $xml);
    }
861650
function xmlString( )
    {
        $doc = new DOMDocument( '1.0', 'utf-8' );

        $root = $doc->createElement( "ezrangeoption" );
        $root->setAttribute( "start_value", $this->StartValue );
        $root->setAttribute( "stop_value", $this->StopValue );
        $root->setAttribute( "step_value", $this->StepValue );
        $doc->appendChild( $root );

        $name = $doc->createElement( "name", $this->Name );
        $root->appendChild( $name );

        $xml = $doc->saveXML();

        return $xml;
    }
1196580
public function createXML() {

        $this->_orderData = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Order></Order>");
        $this->_consumerNode = $this->_orderData->addChild('Consumer');
        $this->_addressesNode = $this->_orderData->addChild('Addresses');
        $this->_productsNode = $this->_orderData->addChild('Products');

        // Set Consumer
        $this->array_to_xml($this->_data['consumer'], $this->_consumerNode);

        // Set Addresses
        $shippingNode = $this->_addressesNode->addChild('Address');
        $shippingNode->addAttribute('id', 'shipping');

        $this->array_to_xml($this->_data['shippingAddress'], $shippingNode);

        $billingNode = $this->_addressesNode->addChild('Address');
        $billingNode->addAttribute('id', 'billing');

        $this->array_to_xml($this->_data['billingAddress'], $billingNode);

        // Set Products
        foreach ($this->_data['products'] as $product) {
            $productNode = $this->_productsNode->addChild('Product');
            $this->array_to_xml($product, $productNode);
        }

        if ($this->_debug == true) {
            header("Content-type: text/xml");
            echo $this->_orderData->asXML();
            exit;
        }

        return $this->_orderData->asXML();
    }
828257
public function generate(): string
    {
        $elements = [];
        if ($this->label != '') {
            $elements[] = Tags::legend($this->label, []);
        }
        foreach ($this->elements as $element) {
            /** @noinspection PhpUndefinedMethodInspection */
            $elements[] = $element->generate();
        }
        return Tags::fieldset($elements, $this->attributes);
    }
327098
public function getGeneratedXML()
    {

        $dom = new XmlDomConstruct('1.0', 'utf-8');
        $dom->fromMixed(array(
            'request' => $this->_args
        ));
        $post_data = $dom->saveXML();
        $post_data = str_replace('<request/>', '<request method="' . $this->_method . '" />', $post_data);
        $post_data = str_replace('<request>', '<request method="' . $this->_method . '">', $post_data);

        return $post_data;

    }
391455
public function xmlOutput() {
        $o = '';
        $o.= '        <KEY NAME="' . $this->name . '"';
        $o.= ' TYPE="' . $this->getXMLDBKeyName($this->type) . '"';
        $o.= ' FIELDS="' . implode(', ', $this->fields) . '"';
        if ($this->type == XMLDB_KEY_FOREIGN ||
            $this->type == XMLDB_KEY_FOREIGN_UNIQUE) {
            $o.= ' REFTABLE="' . $this->reftable . '"';
            $o.= ' REFFIELDS="' . implode(', ', $this->reffields) . '"';
        }
        if ($this->comment) {
            $o.= ' COMMENT="' . htmlspecialchars($this->comment) . '"';
        }
        $o.= '/>' . "\n";

        return $o;
    }
844733
protected function getStructureXml()
    {
        $struct = '<?xml version="1.0" encoding="UTF-8"?>';
        $struct .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" NAMESPACES>URLS</urlset>';

        $namespaces = '';
        foreach ($this->customNamespaces as $key => $location) {
            $namespaces .= ' xmlns:' . $key . '="' . $location . '"';
        }

        $struct = str_replace('NAMESPACES', $namespaces, $struct);

        return $struct;
    }
922554
protected function generatePuml(): string
    {
        $puml = '';

        foreach ([self::XSL_HEADER, self::XSL_TARGETS, self::XSL_CALLS, self::XSL_FOOTER] as $xslFile) {
            $puml .= $this->transformToPuml($xslFile);
        }

        return $puml;
    }
384869
public function toXML()
    {

        $oXMLout = new \XMLWriter();
        $oXMLout->openMemory();
        $oXMLout->setIndent(true);
        $oXMLout->setIndentString('    ');
        $className = explode('\\', get_class($this->entity));

        $className = lcfirst(end($className));

        $nodeName = lcfirst(($this->taskType) . ucfirst($className));

        $oXMLout->startElement($nodeName);

        if($this->entity instanceof Invoice && $this->option && $this->option instanceof InvoiceInstruction){
            $oXMLout->writeAttribute("emailToContact", $this->option->emailToContact);
            if($this->option->templateUid > 0){
                $oXMLout->writeElement('templateUid', $this->option->templateUid);
            }
            if($this->option->emailMessage){
                $oXMLout->writeRaw( "\n".$this->option->emailMessage->toXML());
            }
        }


        $oXMLout->writeRaw("\n".$this->entity->toXML());

        $oXMLout->endElement();

        $string = $oXMLout->outputMemory();

        return $string;

    }
783455
public function getColsXml()
    {
        $colsXml = '';
        if (0 !== count($this->getColumnWidths())) {
            foreach ($this->getColumnWidths() as $columnIndex => $columnWidth) {
                $columnNumber = $columnIndex + 1;
                $colsXml .= sprintf(
                    SheetXml::COLUMN_XML, $columnNumber, $columnNumber, number_format($columnWidth, 3, '.', '')
                );
            }
            $colsXml = sprintf('<cols>%s</cols>', $colsXml);
        }

        return $colsXml;
    }
545899
protected function buildXml()
	{
		$buffer = array();

		$buffer[] = '<?xml version="1.0"?>';
		$buffer[] = '<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
		$buffer[] = ' <database name="">';

		$buffer = array_merge($buffer, $this->buildXmlStructure());

		$buffer[] = ' </database>';
		$buffer[] = '</mysqldump>';

		return implode("\n", $buffer);
	}
247557
private function createFieldsElement($xml)
    {
        $fields = $xml->createElement('fields');

        foreach ($this->fields as $f) {
            $fields->appendChild($this->createFieldElement($xml, $f));
        }

        return $fields;
    }
592071
public function xmlOutput() {
        $o = '';
        $o.= '        <INDEX NAME="' . $this->name . '"';
        if ($this->unique) {
            $unique = 'true';
        } else {
            $unique = 'false';
        }
        $o.= ' UNIQUE="' . $unique . '"';
        $o.= ' FIELDS="' . implode(', ', $this->fields) . '"';
        if ($this->hints) {
            $o.= ' HINTS="' . implode(', ', $this->hints) . '"';
        }
        if ($this->comment) {
            $o.= ' COMMENT="' . htmlspecialchars($this->comment) . '"';
        }
        $o.= '/>' . "\n";

        return $o;
    }
738592
function to_xml(){
		if ($this->skip) return "";
		$str ="";
		
		$str .= "<item value=\"".$this->xmlentities($this->data[$this->config->data[0]['db_name']])."\" label=\"".$this->xmlentities($this->data[$this->config->data[1]['db_name']])."\" />";
		return $str;
	}
965431
public function serialize()
	{
		$xmlString = sprintf(
			'<%s %s>%s</%1$s>',
			$this->_getRootNodeName(),
			$this->_serializeRootAttributes(),
			$this->_serializeContents()
		);
		$canonicalXml = $this->_helper->getPayloadAsDoc($xmlString)->saveXML();
		$this->_schemaValidate($canonicalXml);
		return $canonicalXml;
	}
129033
public function getXmlLang()
	{
		// Take and work on a copy of the node so it can be manipulated
		$node = $this->domNode;

		while ( ! $node instanceof \DOMDocument )
		{
			if ( $node->hasAttributes() )
			{
				foreach ( $node->attributes as $name => $attrNode )
				{
					// This should return the lang attribute of the node if there is one.
					if ( $name != "lang" || $attrNode->localName != "lang" || $attrNode->namespaceURI != XmlReservedNs::xml ) continue;
					return $attrNode->nodeValue;
				}
			}

			// If not, check the parent recursively
			$node = $node->parentNode;
		}

		return "";
	}
572907
public function xml()
    {
        foreach ($this->_result as $ps) {
            $xmlps = $this->xml->addChild("Process");
            $xmlps->addAttribute("Name", $ps[0]);
            $xmlps->addAttribute("Status", $ps[1] ? 1 : 0);
        }

        return $this->xml->getSimpleXmlElement();
    }