generates the XML content for the plugin

@return SimpleXMLElement entire XML content for the plugin
8756
public function xml()
    {
        foreach ($this->_result as $bat_item) {
            $xmlbat = $this->xml->addChild("Bat");
            if (isset($bat_item['name'])) {
                $xmlbat->addAttribute("Name", $bat_item['name']);
            }
            if (isset($bat_item['model']) && ($bat_item['model'] !== "1")) {
                $xmlbat->addAttribute("Model", $bat_item['model']);
            }
            if (defined('PSI_PLUGIN_BAT_SHOW_SERIAL') && PSI_PLUGIN_BAT_SHOW_SERIAL
               && isset($bat_item['serialnumber'])
               && ($bat_item['serialnumber'] !== "")
               && ($bat_item['serialnumber'] !== "0")
               && ($bat_item['serialnumber'] !== "0000")) {
                $xmlbat->addAttribute("SerialNumber", $bat_item['serialnumber']);
            }
            if (isset($bat_item['manufacturer'])) {
                $xmlbat->addAttribute("Manufacturer", $bat_item['manufacturer']);
            }
            if ((!isset($bat_item['remaining_capacity']) || (isset($bat_item['full_capacity']) && ($bat_item['full_capacity'] == 0))) &&
                isset($bat_item['capacity']) && ($bat_item['capacity']>=0)) {
                if (isset($bat_item['capacity_unit']) && ($bat_item['capacity_unit'] !== "???")
                   && (isset($bat_item['full_capacity']) && ($bat_item['full_capacity'] > 0))) {
                    $xmlbat->addAttribute("CapacityUnit", $bat_item['capacity_unit']);
                    $xmlbat->addAttribute("RemainingCapacity", round($bat_item['capacity']*$bat_item['full_capacity']/100));
                    $xmlbat->addAttribute("FullCapacity", $bat_item['full_capacity']);
                    if (isset($bat_item['design_capacity'])) {
                        $xmlbat->addAttribute("DesignCapacity", $bat_item['design_capacity']);
                    }
                } else {
                    $xmlbat->addAttribute("FullCapacity", 100);
                    $xmlbat->addAttribute("RemainingCapacity", $bat_item['capacity']);
                    $xmlbat->addAttribute("CapacityUnit", "%");
                }
            } else {
                if (isset($bat_item['full_capacity'])) {
                    if (isset($bat_item['design_capacity'])) {
                        $xmlbat->addAttribute("DesignCapacity", $bat_item['design_capacity']);
                    }
                    $xmlbat->addAttribute("FullCapacity", $bat_item['full_capacity']);
                } elseif (isset($bat_item['design_capacity'])) {
                    $xmlbat->addAttribute("FullCapacity", $bat_item['design_capacity']);
                }
                if (isset($bat_item['remaining_capacity'])) {
                    $xmlbat->addAttribute("RemainingCapacity", $bat_item['remaining_capacity']);
                }
                if (isset($bat_item['capacity_unit'])) {
                    $xmlbat->addAttribute("CapacityUnit", $bat_item['capacity_unit']);
                }
            }
            if (isset($bat_item['design_voltage']) && ($bat_item['design_voltage']>0)) {
                $xmlbat->addAttribute("DesignVoltage", $bat_item['design_voltage']);
                if (isset($bat_item['design_voltage_max']) && ($bat_item['design_voltage_max']>0) && ($bat_item['design_voltage_max'] != $bat_item['design_voltage'])) {
                    $xmlbat->addAttribute("DesignVoltageMax", $bat_item['design_voltage_max']);
                }
            } elseif (isset($bat_item['design_voltage_max']) && ($bat_item['design_voltage_max']>0)) {
                $xmlbat->addAttribute("DesignVoltage", $bat_item['design_voltage_max']);
            }
            if (isset($bat_item['present_voltage'])) {
                $xmlbat->addAttribute("PresentVoltage", $bat_item['present_voltage']);
            }
            if (isset($bat_item['charging_state'])) {
                $xmlbat->addAttribute("ChargingState", $bat_item['charging_state']);
            } else {
                if (isset($bat_item['charging_state_i'])) {
                    $xmlbat->addAttribute("ChargingState", 'Charging');
                } elseif (!isset($bat_item['charging_state_e'])) {
                    $xmlbat->addAttribute("ChargingState", 'Discharging');
                } elseif (isset($bat_item['charging_state_f'])) {
                    $xmlbat->addAttribute("ChargingState", 'Fully Charged');
                } else {
                    $xmlbat->addAttribute("ChargingState", 'Unknown state');
                }
            }
            if (isset($bat_item['battery_type'])) {
                $xmlbat->addAttribute("BatteryType", $bat_item['battery_type']);
            }
            if (isset($bat_item['battery_temperature'])) {
                $xmlbat->addAttribute("BatteryTemperature", $bat_item['battery_temperature']);
            }
            if (isset($bat_item['battery_condition'])) {
                $xmlbat->addAttribute("BatteryCondition", $bat_item['battery_condition']);
            }
            if (isset($bat_item['cycle_count'])) {
                $xmlbat->addAttribute("CycleCount", $bat_item['cycle_count']);
            }
        }

        return $this->xml->getSimpleXmlElement();
    }
784566
public function toXML(){

            $oXMLout = new \XMLWriter();
            $oXMLout->openMemory();
            $oXMLout->setIndent(true);
            $oXMLout->setIndentString('    ');


        $oXMLout->startDocument("1.0", 'utf-8');
        $oXMLout->startElement('tasks');

        /**
         * @var \Dlin\Saasu\Task\Task $task
         */
        foreach($this->tasks as $task){
           $oXMLout->writeRaw("\n".$task->toXML());
        }
        $oXMLout->endElement();
        $oXMLout->endDocument();

        $xml = $oXMLout->outputMemory();

        return $xml;
    }
1037553
public function toXml()
    {
        $messages = '';
        /** @var ShortMessage $shortMessage */
        foreach ($this->items as $shortMessage) {
            $messages .= $shortMessage->toMultipleMessagesXml();
        }

        return $messages;
    }
1289633
protected function getXML()
    {
        $key = 'xml_' . md5($this->url); // Everybody loves md5!

        if ($this->cache->has($key)) {
            $this->xml = $this->cache->get($key);
        } else {
            $this->xml = $this->fetchXML();

            $this->xml = $this->changeLinkElements($this->xml);

            $this->cache->put($key, $this->xml, $this->cacheTime);
        }
    }
295596
public function outputXML ()
	{
		
		// Create DOMDocument
		
		$doc	= new \DOMDocument ('1.0', 'UTF-8');
		
		// Generate XML
		
		$xml	= $this->generateXML ($doc);
		
		// Append XML
		
		$doc->appendChild ($xml);
		
		// Return XML
		
		return $doc->saveXML ();
		
	}
260121
protected function generateFileContents()
    {
        $data = $this->classTemplate;

        $data = str_replace("{EXTENDS}", $this->extends, $data);
        $data = str_replace("{NAMESPACE}", $this->namespace, $data);
        $data = str_replace("{CLASSNAME}", $this->classname, $data);
        $data = str_replace("{CONTENTS}", $this->contents, $data);
        $data = str_replace("{USES}", $this->uses, $data);

        return $data;
    }
498241
public function serializeToXml()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
        $xml->addChild('StorageCapacity', strval($this->storageCapacity));
        return $xml->asXML();
    }
137431
protected function _getXml()
    {
        if ($this->_xml) {
            return $this->_xml;
        }
        libxml_use_internal_errors();
        $data = simplexml_load_string($this->_getBody());
        if ($data) {
            $this->_xml = $data;

            return $this->_xml;
        }

        return null;
    }
226922
function xmlString()
    {
        $doc = new DOMDocument( '1.0', 'utf-8' );
        $root = $doc->createElement( "ezmultioption2" );
        $doc->appendChild( $root );


        $this->createDomElementForGroup( $doc, $root );

        $rulesNode = $doc->createElement( "rules" );

        foreach ( $this->Rules as $ruleFor => $rule )
        {
            unset( $ruleNode );
            $ruleNode = $doc->createElement( "rule" );
            $ruleNode->setAttribute( "option_id", $ruleFor );
            foreach ( $rule as $multioptionID => $ruleData )
            {
                unset( $ruleDataNode );
                $ruleDataNode = $doc->createElement( "rule_data" );
                $ruleDataNode->setAttribute( "multioption_id", $multioptionID );
                foreach ( $ruleData as $optionID )
                {
                    unset( $includeNode );
                    $includeNode = $doc->createElement( "option_id", $optionID );
                    $ruleDataNode->appendChild( $includeNode );
                }
                $ruleNode->appendChild( $ruleDataNode );
            }
            $rulesNode->appendChild( $ruleNode );
        }
        $root->appendChild( $rulesNode );

        $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();
    }
671222
public function getXMLContent()
    {
        if ($this->xmlContent === null) {
            try {
                if (($content = $this->content) === '') {
                    return $this->xmlContent = false;
                }

                $errors = libxml_use_internal_errors(true);
                $this->xmlContent = new SimpleXMLElement($content);
                libxml_use_internal_errors($errors);
            } catch (Exception $exception) {
                return $this->xmlContent = false;
            }
        }

        return $this->xmlContent;
    }
408807
public function toXML()
    {
        $namespace = 'tns';
        $writer = new XMLWriter();
        $writer->openMemory();
        $writer->setIndent(true);
        $writer->setIndentString('    ');
        $writer->startElementNs($namespace, $this->getRequestName(), 'http://www.apis-it.hr/fin/2012/types/f73');
        $writer->writeAttribute('Id', uniqid());
        $writer->startElementNs($namespace, 'Zaglavlje', null);
        $writer->writeElementNs($namespace, 'IdPoruke', null, $this->generateUUID());
        $writer->writeElementNs($namespace, 'DatumVrijeme', null, $this->generateDateTime());
        $writer->endElement();
        $writer->writeRaw($this->getRequest()->toXML());
        $writer->endElement();

        return $writer->outputMemory();
    }
459382
public function toXML()
    {
        $namespace = 'tns';
        $writer = new XMLWriter();
        $writer->openMemory();
        $writer->setIndent(true);
        $writer->setIndentString('    ');
        $writer->startElementNs($namespace, 'Racun', null);
        $writer->writeElementNs($namespace, 'Oib', null, $this->getOib());
        $writer->writeElementNs($namespace, 'USustPdv', null, $this->getRegisteredForPdv() ? 'true' : 'false');
        $writer->writeElementNs($namespace, 'DatVrijeme', null, $this->getDateTime());
        $writer->writeElementNs($namespace, 'OznSlijed', null, $this->getIncrementType());
        $writer->writeRaw($this->invoiceNumber->toXML());

        /********** PDV **********/
        if (!empty($this->getPdvTaxes())) {
            $writer->startElementNs($namespace, 'Pdv', null);
            foreach ($this->getPdvTaxes() as $pdv) {
                $writer->writeRaw($pdv->toXML());
            }
            $writer->endElement();
        }

        /********** PNP **********/
        if (!empty($this->getPnpTaxes())) {
            $writer->startElementNs($namespace, 'Pnp', null);
            foreach ($this->getPnpTaxes() as $pnp) {
                $writer->writeRaw($pnp->toXML());
            }
            $writer->endElement();
        }

        /********** Other Tax **********/
        if (!empty($this->getOtherTaxes())) {
            $writer->startElementNs($namespace, 'OstaliPor', null);
            foreach ($this->getOtherTaxes() as $otherTax) {
                $writer->writeRaw($otherTax->toXML());
            }
            $writer->endElement();
        }

        $writer->writeElementNs($namespace, 'IznosOslobPdv', null, $this->getTaxFreeValue());
        $writer->writeElementNs($namespace, 'IznosMarza', null, $this->getMarginTaxValue());
        $writer->writeElementNs($namespace, 'IznosNePodlOpor', null, $this->getTaxExemptValue());

        /********** Fee **********/
        if (!empty($this->getFees())) {
            $writer->startElementNs($namespace, 'Naknade', null);
            foreach ($this->getFees() as $fee) {
                $writer->writeRaw($fee->toXML());
            }
            $writer->endElement();
        }
        $writer->writeElementNs($namespace, 'IznosUkupno', null, $this->getTotalValue());
        $writer->writeElementNs($namespace, 'NacinPlac', null, $this->getPaymentType());
        $writer->writeElementNs($namespace, 'OibOper', null, $this->getOperatorOib());
        $writer->writeElementNs($namespace, 'ZastKod', null, $this->getSecurityCode());
        $writer->writeElementNs($namespace, 'NakDost', null, $this->getResendFlag() ? 'true' : 'false');
        if ($this->getParagonInvoiceNumber()) {
            $writer->writeElementNs($namespace, 'ParagonBrRac', null, $this->getParagonInvoiceNumber());
        }
        if ($this->getSpecificPurpose()) {
            $writer->writeElementNs($namespace, 'SpecNamj', null, $this->getSpecificPurpose());
        }
        $writer->endElement();

        return $writer->outputMemory();
    }
73580
private function loadXML()
    {
        $xml = str_replace($this->replaceNamespaces, '', $this->getXml());
        $this->xmlData = \simplexml_load_string($xml);
    }
1307313
public function getInnerXml()
	{
		if ( is_null( $this->domNode ) ) return null;
		$owner = $this->domNode instanceof \DOMDocument ? $this->domNode : $this->domNode->ownerDocument;
		$xml = $owner->saveXml( $this->domNode, LIBXML_NOEMPTYTAG );
		$xml = ltrim( preg_replace( "/^<\?xml.*\?>/", "", $xml ) );
		$xml = ltrim( preg_replace( "/^<!DOCTYPE[^>[]*(\[[^]]*\])?>/s", "", $xml ) );
		return $xml;
	}
441225
public function toXml()
    {
        if ($this->blank())
            return;
        
        $t = get_class($this->current());
        
        $xml = '<?xml version="1.0" encoding="UTF-8"?>';
        $xml .= '<' . $t . '>';
        
        foreach ($this->members() as $obj) {
            $xml .= $obj->toXml(array('skip_instruct' => true));
        }
        
        $xml .= '</' . $t . '>';
        
        return $xml;
    }
984986
public function getOuterXml()
	{
		if ( is_null( $this->domNode ) ) return "";
		return is_null( $this->domNode->parentNode )
			? $this->domNode->ownerDocument->saveXml( $this->domNode )
			: $this->domNode->ownerDocument->saveXml( $this->domNode->parentNode );
	}