Builds the XML data for the tables to export.

@return  string  An XML string

@since   1.0
@throws  \Exception if an error occurs.
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);
	}
119173
public function xml()
    {
        if (strtoupper($this->encoding) !== 'ISO-8859-1') {
            return false;
        }
        try {
            $converted = utf8_encode($this->string);
        } catch (\Exception $e) {
            return false;
        }
        return $converted;
    }
764118
protected function buildXml()
    {
        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");

        // Create the "ConnectorInfo" node.
        $_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
        $this->_connectorNode->addChild($_oConnInfo);
        $_oConnInfo->addAttribute("enabled", $_config->getIsEnabled() ? "true" : "false");

        if (!$_config->getIsEnabled()) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
        }

        $_ln = '' ;
        $_lc = $_config->getLicenseKey() . '                                  ' ;
        $pos = strpos( CKFINDER_CHARS, $_lc[0] ) % 5;
        if ( $pos == 1 || $pos == 4 ) {
            $_ln = $_config->getLicenseName() ;
        }

        $_oConnInfo->addAttribute("s", $_ln);
        $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
        $_thumbnailsConfig = $_config->getThumbnailsConfig();
        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
        $_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
        if ($_thumbnailsEnabled) {
            $_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
            $_oConnInfo->addAttribute("thumbsWidth", $_thumbnailsConfig->getMaxWidth());
            $_oConnInfo->addAttribute("thumbsHeight", $_thumbnailsConfig->getMaxHeight());
        }
        $_imagesConfig = $_config->getImagesConfig();
        $_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
        $_oConnInfo->addAttribute("imgHeight", $_imagesConfig->getMaxHeight());

        // Create the "ResourceTypes" node.
        $_oResourceTypes = new Ckfinder_Connector_Utils_XmlNode("ResourceTypes");
        $this->_connectorNode->addChild($_oResourceTypes);
        // Create the "PluginsInfo" node.
        $_oPluginsInfo = new Ckfinder_Connector_Utils_XmlNode("PluginsInfo");
        $this->_connectorNode->addChild($_oPluginsInfo);

        // Load the resource types in an array.
        $_aTypes = $_config->getDefaultResourceTypes();

        if (!sizeof($_aTypes)) {
            $_aTypes = $_config->getResourceTypeNames();
        }

        $_aTypesSize = sizeof($_aTypes);
        if ($_aTypesSize) {
            $phpMaxSize = 0;
            $max_upload = CKFinder_Connector_Utils_Misc::returnBytes(ini_get('upload_max_filesize'));
            if ($max_upload) {
              $phpMaxSize = $max_upload;
            }
            $max_post = CKFinder_Connector_Utils_Misc::returnBytes(ini_get('post_max_size'));
            if ($max_post) {
              $phpMaxSize = $phpMaxSize ? min($phpMaxSize, $max_post) : $max_post;
            }
            //ini_get('memory_limit') only works if compiled with "--enable-memory-limit"
            $memory_limit = CKFinder_Connector_Utils_Misc::returnBytes(@ini_get('memory_limit'));
            if ($memory_limit && $memory_limit != -1) {
              $phpMaxSize = $phpMaxSize ? min($phpMaxSize, $memory_limit) : $memory_limit;
            }
            $_oConnInfo->addAttribute("uploadMaxSize", $phpMaxSize);
            $_oConnInfo->addAttribute("uploadCheckImages", $_config->checkSizeAfterScaling() ? "false" : "true");
            for ($i = 0; $i < $_aTypesSize; $i++)
            {
                $_resourceTypeName = $_aTypes[$i];

                $_acl = $_config->getAccessControlConfig();
                $_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");

                if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
                    continue;
                }

                if (!isset($_GET['type']) || $_GET['type'] === $_resourceTypeName) {
                    //print $_resourceTypeName;
                    $_oTypeInfo = $_config->getResourceTypeConfig($_resourceTypeName);
                    //print_r($_oTypeInfo);
                    $_oResourceType[$i] = new Ckfinder_Connector_Utils_XmlNode("ResourceType");
                    $_oResourceTypes->addChild($_oResourceType[$i]);

                    $_oResourceType[$i]->addAttribute("name", $_resourceTypeName);
                    $_oResourceType[$i]->addAttribute("url", $_oTypeInfo->getUrl());
                    $_oResourceType[$i]->addAttribute("allowedExtensions", implode(",", $_oTypeInfo->getAllowedExtensions()));
                    $_oResourceType[$i]->addAttribute("deniedExtensions", implode(",", $_oTypeInfo->getDeniedExtensions()));
                    $_oResourceType[$i]->addAttribute("hash", $_oTypeInfo->getHash());
                    $_oResourceType[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren('/', $_oTypeInfo) ? "true" : "false");
                    $_oResourceType[$i]->addAttribute("acl", $_aclMask);
                    $maxSize = $_oTypeInfo->getMaxSize();
                    if ($phpMaxSize) {
                      $maxSize = $maxSize ? min($maxSize, $phpMaxSize) : $phpMaxSize;
                    }
                    $_oResourceType[$i]->addAttribute("maxSize", $maxSize);
                }
            }
        }

        $config = $GLOBALS['config'];
        if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
            $_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
        }

        CKFinder_Connector_Core_Hooks::run('InitCommand', array(&$this->_connectorNode));
    }
20513
public function buildXml()
  {
    if (!extension_loaded('zip')) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND);
    }

    $this->checkConnector();
    $this->checkRequest();

    if ( !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_UPLOAD)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
    }

    $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
    $currentResourceTypeConfig = $this->_currentFolder->getResourceTypeConfig();
    $_sServerDir = $this->_currentFolder->getServerPath();

    $files = array();

    $_zipFilesSize = 0;
    $config = $this->getConfig();
    $zipMaxSize = $config['zipMaxSize'];
    if ( !empty($zipMaxSize) && $zipMaxSize == 'default' ){
      $zipMaxSize = $currentResourceTypeConfig->getMaxSize();
    }

    $_isBasket = ( isset($_POST['basket']) && $_POST['basket'] == 'true' )? true : false;

    if ( !empty($_POST['files']))
    {

      $_aclConfig = $this->_config->getAccessControlConfig();
      $aclMasks = array();
      $_resourceTypeConfig = array();

      foreach ( $_POST['files'] as $arr ){
        if ( empty($arr['name']) || empty($arr['type']) || empty($arr['folder']) ) {
          continue;
        }
        // file name
        $name = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($arr['name']);
        // resource type
        $type = $arr['type'];
        // client path
        $path = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($arr['folder']);

        // check #1 (path)
        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($name) || preg_match(CKFINDER_REGEX_INVALID_PATH, $path)) {
          continue;
        }

        // get resource type config for current file
        if (!isset($_resourceTypeConfig[$type])) {
          $_resourceTypeConfig[$type] = $this->_config->getResourceTypeConfig($type);
        }

        // check #2 (resource type)
        if (is_null($_resourceTypeConfig[$type])) {
          continue;
        }

        // check #3 (extension)
        if (!$_resourceTypeConfig[$type]->checkExtension($name, false)) {
          continue;
        }

        // check #4 (extension) - when moving to another resource type, double check extension
        if ($currentResourceTypeConfig->getName() != $type && !$currentResourceTypeConfig->checkExtension($name, false)) {
          continue;
        }

        // check #5 (hidden folders)
        // cache results
        if (empty($checkedPaths[$path])) {
          $checkedPaths[$path] = true;

          if ($_resourceTypeConfig[$type]->checkIsHiddenPath($path)) {
            continue;
          }
        }

        // check #6 (hidden file name)
        if ($currentResourceTypeConfig->checkIsHiddenFile($name)) {
          continue;
        }

        // check #7 (Access Control, need file view permission to source files)
        if (!isset($aclMasks[$type."@".$path])) {
          $aclMasks[$type."@".$path] = $_aclConfig->getComputedMask($type, $path);
        }

        $isAuthorized = (($aclMasks[$type."@".$path] & CKFINDER_CONNECTOR_ACL_FILE_VIEW) == CKFINDER_CONNECTOR_ACL_FILE_VIEW);
        if (!$isAuthorized) {
          continue;
        }

        $sourceFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($_resourceTypeConfig[$type]->getDirectory().$path,$name);
        // check #8 (invalid file name)
        if (!file_exists($sourceFilePath) || !is_file($sourceFilePath)) {
          continue;
        }

        // check #9 - max file size
        if ( !empty($zipMaxSize) ){
          clearstatcache();
          $_zipFilesSize += filesize($sourceFilePath);
          if ( $_zipFilesSize > $zipMaxSize ) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CREATED_FILE_TOO_BIG);
          }
        }

        $zipPathPart = ( $_isBasket ) ? CKFinder_Connector_Utils_FileSystem::combinePaths($type,$path) : '';

        $files[$sourceFilePath] = $zipPathPart.pathinfo($sourceFilePath,PATHINFO_BASENAME);
      }
    }
    else
    {
      if (!is_dir($_sServerDir)) {
        $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
      }
      $files = $this->getFilesRecursively($_sServerDir,$zipMaxSize);
    }
    if ( sizeof($files)<1) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
    }
    // default destination dir - temp
    $dest_dir = CKFinder_Connector_Utils_FileSystem::getTmpDir();
    $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();

    // default file name - hash
    $zip_filename = substr(md5(serialize($files)), 0, 16).$resourceTypeInfo->getHash().'.zip';

    // compress files - do not download them
    // change destination and name
    if ( isset($_POST['download']) && $_POST['download'] == 'false'){
      $dest_dir = $_sServerDir;
      if ( isset($_POST['zipName']) && !empty($_POST['zipName'])){
        $zip_filename = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST['zipName']);
        if (!$resourceTypeInfo->checkExtension($zip_filename)) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION);
        }
      }
    }
    if (!CKFinder_Connector_Utils_FileSystem::checkFileName($zip_filename) || $resourceTypeInfo->checkIsHiddenFile($zip_filename)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
    }
    if ($this->_config->forceAscii()) {
      $zip_filename = CKFinder_Connector_Utils_FileSystem::convertToAscii($zip_filename);
    }

    $zipFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($dest_dir, $zip_filename);

    if (!is_writable(dirname($zipFilePath))) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
    }

    // usually we would need to create zip?
    $createZip = true;

    // only if file already exists and we want download it
    // do not create new one - because hash of previously created is the same - existing archive is ok
    if ( file_exists($zipFilePath) && isset($_POST['download']) && $_POST['download'] == 'true' ){
      $createZip = false;
    }
    // if we only want to create archive
    else
    {
      if ( file_exists($zipFilePath) && ( !isset($_POST['fileExistsAction']) || !in_array($_POST['fileExistsAction'], array('autorename','overwrite')) ) ){
        $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
      }

      if ( !$this->_currentFolder->checkAcl( CKFINDER_CONNECTOR_ACL_FILE_UPLOAD )) {
        $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
      }
      // check how to deal with existing file
      if ( isset($_POST['fileExistsAction']) && $_POST['fileExistsAction'] == 'autorename' )
      {
        if ( !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_UPLOAD | CKFINDER_CONNECTOR_ACL_FILE_RENAME )) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
        }
        $zip_filename = CKFinder_Connector_Utils_FileSystem::autoRename($dest_dir, $zip_filename);
        $zipFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($dest_dir, $zip_filename);
      }
      elseif ( isset($_POST['fileExistsAction']) && $_POST['fileExistsAction'] == 'overwrite' )
      {
        if ( !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_RENAME | CKFINDER_CONNECTOR_ACL_FILE_DELETE)) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
        }
        if (!CKFinder_Connector_Utils_FileSystem::unlink($zipFilePath)){
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
        }
      }
    }

    if ( $createZip ){
      $zip = new ZipArchive();
      $result = $zip->open( $zipFilePath, ZIPARCHIVE::CREATE);
      if ( $result !== TRUE ) {
        $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNKNOWN);
      }
      foreach ( $files as $pathname => $filename ){
        if ( !empty($filename) ){
          if ( file_exists($pathname) && is_readable($pathname) ){
            $zip->addFile( $pathname, $filename );
          }
        } else {
          $zip->addEmptyDir( $pathname );
        }
      }
      $zip->close();
    }

    $file = new CKFinder_Connector_Utils_XmlNode("ZipFile");
    $file->addAttribute("name", $zip_filename);
    $this->_connectorNode->addChild($file);
  }
923307
private function build(): void
    {
        $prefix = "<?xml version='1.0' encoding='UTF-8'?>" . $this->glue() . "<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>";
        $suffix = '</feed>';

        $xml = collect($this->filters)->map(function ($items) {
            return $this->buildEntry($items);
        })->implode($this->glue());

        $this->xml = collect([$prefix, $xml, $suffix])->implode($this->glue());

        if ($this->writeFile) {
            $this->filesystem->dumpFile($this->outputFile, $this->xml);
        }
    }
1353415
function to_xml(){
		if ($this->skip) return false;
		
		$data = array(
			'id' => $this->get_id()
		);
		for ($i=0; $i<sizeof($this->config->text); $i++){
			$extra = $this->config->text[$i]["name"];
			$data[$extra]=$this->data[$extra];
			if (is_null($data[$extra]))
			    $data[$extra] = "";
		}

		if ($this->userdata !== false)
			foreach ($this->userdata as $key => $value){
				if ($value === null)
					$data[$key]="";
				$data[$key]=$value;
			}

		return $data;
	}
646977
public function xml2query()
    {
        if (array_key_exists("CogModule", $this->data)) {
            $q = &$this->data["CogModule"];
        } else {
            $q = &$this->data["Report"];
        }

        $criteria_links = array();

        // Generate Output Information...
        $ds = false;
        if (!$q) {
            return;
        }

        foreach ($q as $cogquery) {
            // Set Query Attributes
            foreach ($cogquery["Format"] as $att => $val) {
                $this->query->setAttribute($att, $val);
            }

            // Set DataSource
            if (isset($cogquery["Datasource"])) {
                foreach ($cogquery["Datasource"] as $att => $val) {
                    //if ( $att == "SourceType" )
                    //$this->query->source_type = $val;

                    if ($att == "SourceConnection") {
                        // No longer relevant - connections are not supplied in xml files
                    }
                }
            }

            // Set Query Columns
            if (!($ef = &$this->getArrayElement($cogquery, "EntryForm"))) {
                $this->ErrorMsg = "No EntryForm tag within Format";
                return false;
            }

            if (!($qu = &$this->getArrayElement($ef, "Query"))) {
                $this->ErrorMsg = "No Query tag within EntryForm";
                return false;
            }

            $this->query->table_text = $this->getArrayElement($qu, "TableSql");
            $this->query->where_text = $this->getArrayElement($qu, "WhereSql");
            $this->query->group_text = $this->getArrayElement($qu, "GroupSql");
            $this->query->rowselection = $this->getArrayElement($qu, "RowSelection");
            $has_cols = true;

            if (($qc = &$this->getArrayElement($qu, "SQL"))) {
                $this->query->sql_raw = $this->getArrayElement($qc, "SQLRaw");
            }

            if (!($qc = &$this->getArrayElement($qu, "QueryColumns"))) {
                $this->ErrorMsg = "No QueryColumns tag within Query";
                $has_cols = false;
            }

            // Generate QueryColumn for each column found
            if ($has_cols) {
                foreach ($qc as $col) {
                    $in_query = true;
                    if (!$col["ColumnName"]) {
                        $in_query = false;
                    }

                    $this->query->createCriteriaColumn
                    (
                        $col["Name"],
                        $col["TableName"],
                        $col["ColumnName"],
                        $col["ColumnType"],
                        $col["ColumnLength"],
                        "###.##",
                        $in_query
                    );

                    // Set any Attributes
                    if (($fm = &$this->getArrayElement($col, "Format"))) {
                        foreach ($fm as $att => $val) {
                            $this->query->setColumnAttribute($col["Name"], $att, $val);
                        }
                    }
                }

                // Generate Order By List
                if (($oc = &$this->getArrayElement($qu, "OrderColumns"))) {
                    // Generate QueryColumn for each column found
                    foreach ($oc as $col) {
                        if (!$col["Name"]) {
                            return;
                        }

                        $this->query->createQueryColumn
                        (
                            $col["Name"],
                            $col["OrderType"]
                        );
                    }
                }

                // Generate Query Assignments
                if (($as = &$this->getArrayElement($ef, "Assignments"))) {
                    foreach ($as as $col) {
                        if (array_key_exists("AssignName", $col)) {
                            $this->query->addAssignment($col["AssignName"], $col["Expression"], $col["Condition"]);
                        } else {
                            $this->query->addAssignment($col["Name"], $col["Expression"], $col["Condition"]);
                        }

                    }
                }
            }

            // Generate Query Assignments
            if (($pq = &$this->getArrayElement($qu, "PreSQLS"))) {
                foreach ($pq as $col) {
                    $this->query->addPreSql($col["SQLText"]);
                }
            }

            // Generate Output Information...
            if (($op = &$this->getArrayElement($ef, "Output"))) {
                // Generate Page Headers
                if (($ph = $this->getArrayElement($op, "PageHeaders"))) {
                    foreach ($ph as $k => $phi) {
                        $this->query->createPageHeader($k, $phi["LineNumber"], $phi["HeaderText"]);
                        if (($fm = &$this->getArrayElement($phi, "Format"))) {
                            foreach ($fm as $att => $val) {
                                $this->query->setPageHeaderAttribute($k, $att, $val);
                            }
                        }

                    }
                }

                // Generate Page Footers
                if (($ph = $this->getArrayElement($op, "PageFooters"))) {
                    foreach ($ph as $k => $phi) {
                        $this->query->createPageFooter($k, $phi["LineNumber"], $phi["FooterText"]);
                        if (($fm = &$this->getArrayElement($phi, "Format"))) {
                            foreach ($fm as $att => $val) {
                                $this->query->setPageFooterAttribute($k, $att, $val);
                            }
                        }

                    }
                }

                // Generate Display Orders
                if ($has_cols && ($ph = $this->getArrayElement($op, "DisplayOrders"))) {
                    foreach ($ph as $k => $phi) {
                        $this->query->setColumnOrder($phi["ColumnName"], $phi["OrderNumber"]);
                    }
                }

                if ($has_cols && ($ph = $this->getArrayElement($op, "Groups"))) {
                    foreach ($ph as $k => $phi) {
                        if (array_key_exists("GroupName", $phi)) {
                            $gpname = $phi["GroupName"];
                        } else {
                            $gpname = $phi["Name"];
                        }

                        $grn = $this->query->createGroup($gpname);

                        if (array_key_exists("BeforeGroupHeader", $phi)) {
                            $grn->setAttribute("before_header", $phi["BeforeGroupHeader"]);
                            $grn->setAttribute("after_header", $phi["AfterGroupHeader"]);
                            $grn->setAttribute("before_trailer", $phi["BeforeGroupTrailer"]);
                            $grn->setAttribute("after_trailer", $phi["AfterGroupTrailer"]);
                            $grn->setFormat("before_header", $phi["BeforeGroupHeader"]);
                            $grn->setFormat("after_header", $phi["AfterGroupHeader"]);
                            $grn->setFormat("before_trailer", $phi["BeforeGroupTrailer"]);
                            $grn->setFormat("after_trailer", $phi["AfterGroupTrailer"]);
                        }

                        if (($gp = &$this->getArrayElement($phi, "GroupHeaders"))) {
                            foreach ($gp as $att => $val) {
                                if (!isset($val["GroupHeaderCustom"])) {
                                    $val["GroupHeaderCustom"] = false;
                                }

                                if (!isset($val["ShowInHTML"])) {
                                    $val["ShowInHTML"] = "yes";
                                }

                                if (!isset($val["ShowInPDF"])) {
                                    $val["ShowInPDF"] = "yes";
                                }

                                $this->query->createGroupHeader($gpname, $val["GroupHeaderColumn"], $val["GroupHeaderCustom"], $val["ShowInHTML"], $val["ShowInPDF"]);
                            }
                        }

                        if (($gp = &$this->getArrayElement($phi, "GroupTrailers"))) {
                            foreach ($gp as $att => $val) {
                                if (!isset($val["GroupTrailerCustom"])) {
                                    $val["GroupTrailerCustom"] = false;
                                }

                                if (!isset($val["ShowInHTML"])) {
                                    $val["ShowInHTML"] = "yes";
                                }

                                if (!isset($val["ShowInPDF"])) {
                                    $val["ShowInPDF"] = "yes";
                                }

                                $this->query->createGroupTrailer($gpname, $val["GroupTrailerDisplayColumn"],
                                    $val["GroupTrailerValueColumn"],
                                    $val["GroupTrailerCustom"], $val["ShowInHTML"], $val["ShowInPDF"]);
                            }
                        }

                    }
                }

                // Generate Graphs
                if ($has_cols && ($gph = $this->getArrayElement($op, "Graphs"))) {
                    foreach ($gph as $k => $gphi) {
                        $ka = array_keys($gphi);
                        $gph = &$this->query->createGraph();

                        $gph->setGraphColumn($gphi["GraphColumn"]);

                        $gph->setTitle($gphi["Title"]);
                        $gph->setXtitle($gphi["XTitle"]);
                        $gph->setXlabelColumn($gphi["XLabelColumn"]);
                        $gph->setYtitle($gphi["YTitle"]);
                        //$gph->setYlabelColumn($gphi["YLabelColumn"]);
                        //////HERE!!!
                        if (array_key_exists("GraphWidth", $gphi)) {
                            $gph->setWidth($gphi["GraphWidth"]);
                            $gph->setHeight($gphi["GraphHeight"]);
                            $gph->setWidthPdf($gphi["GraphWidthPDF"]);
                            $gph->setHeightPdf($gphi["GraphHeightPDF"]);
                        } else {
                            $gph->setWidth($gphi["Width"]);
                            $gph->setHeight($gphi["Height"]);
                        }

                        if (array_key_exists("GraphColor", $gphi)) {
                            $gph->setGraphColor($gphi["GraphColor"]);
                            $gph->setGrid($gphi["GridPosition"],
                                $gphi["XGridDisplay"], $gphi["XGridColor"],
                                $gphi["YGridDisplay"], $gphi["YGridColor"]
                            );
                            $gph->setTitleFont($gphi["TitleFont"], $gphi["TitleFontStyle"],
                                $gphi["TitleFontSize"], $gphi["TitleColor"]);
                            $gph->setXtitleFont($gphi["XTitleFont"], $gphi["XTitleFontStyle"],
                                $gphi["XTitleFontSize"], $gphi["XTitleColor"]);
                            $gph->setYtitleFont($gphi["YTitleFont"], $gphi["YTitleFontStyle"],
                                $gphi["YTitleFontSize"], $gphi["YTitleColor"]);
                            $gph->setXaxis($gphi["XTickInterval"], $gphi["XTickLabelInterval"], $gphi["XAxisColor"]);
                            $gph->setYaxis($gphi["YTickInterval"], $gphi["YTickLabelInterval"], $gphi["YAxisColor"]);
                            $gph->setXaxisFont($gphi["XAxisFont"], $gphi["XAxisFontStyle"],
                                $gphi["XAxisFontSize"], $gphi["XAxisFontColor"]);
                            $gph->setYaxisFont($gphi["YAxisFont"], $gphi["YAxisFontStyle"],
                                $gphi["YAxisFontSize"], $gphi["YAxisFontColor"]);
                            $gph->setMarginColor($gphi["MarginColor"]);
                            $gph->setMargins($gphi["MarginLeft"], $gphi["MarginRight"],
                                $gphi["MarginTop"], $gphi["MarginBottom"]);
                        }
                        foreach ($gphi["Plots"] as $pltk => $pltv) {
                            $pl = &$gph->createPlot($pltv["PlotColumn"]);
                            $pl["type"] = $pltv["PlotType"];
                            $pl["fillcolor"] = $pltv["FillColor"];
                            $pl["linecolor"] = $pltv["LineColor"];
                            $pl["legend"] = $pltv["Legend"];
                        }
                    }
                }

            } // Output

            // Check for Criteria Items ...

            if (($crt = &$this->getArrayElement($ef, "Criteria"))) {
                foreach ($crt as $ci) {
                    $critnm = $this->getArrayElement($ci, "Name");

                    $crittb = $this->getArrayElement($ci, "QueryTableName");
                    $critcl = $this->getArrayElement($ci, "QueryColumnName");
                    $linked_report = $this->getArrayElement($ci, "LinkToReport");
                    $linked_report_item = $this->getArrayElement($ci, "LinkToReportItem");

                    // If we are not designing a report then
                    // replace a linked criteria with the criteria
                    // item it links to from another report
                    if ($linked_report && $this->query->execute_mode != "MAINTAIN") {
                        $q = new Reportico();
                        $q->reports_path = $q->projects_folder . "/" . ReporticoApp::getConfig("project");
                        $reader = new XmlReader($q, $linked_report, false);
                        $reader->xml2query();

                        foreach ($q->lookup_queries as $k => $v) {

                            $found = false;
                            foreach ($this->query->columns as $querycol) {
                                if ($querycol->query_name == $v->query_name) {
                                    $found = true;
                                }
                            }

                            $qu = new Reportico();
                            if ($linked_report_item == $v->query_name) {
                                $this->query->lookup_queries[$v->query_name] = $v;
                            }

                        }
                        continue;
                    }

                    if ($crittb) {
                        $critcl = $crittb . "." . $critcl;
                        $crittb = "";
                    }
                    $crittp = $this->getArrayElement($ci, "CriteriaType");
                    $critlt = $this->getArrayElement($ci, "CriteriaList");
                    $crituse = $this->getArrayElement($ci, "Use");
                    $critds = $this->getArrayElement($ci, "CriteriaDisplay");
                    $critexp = $this->getArrayElement($ci, "ExpandDisplay");
                    $critmatch = $this->getArrayElement($ci, "MatchColumn");
                    $critdefault = $this->getArrayElement($ci, "CriteriaDefaults");
                    $crithelp = $this->getArrayElement($ci, "CriteriaHelp");
                    $crittitle = $this->getArrayElement($ci, "Title");
                    $crit_required = $this->getArrayElement($ci, "CriteriaRequired");
                    $crit_hidden = $this->getArrayElement($ci, "CriteriaHidden");
                    $crit_display_group = $this->getArrayElement($ci, "CriteriaDisplayGroup");
                    $crit_lookup_return = $this->getArrayElement($ci, "ReturnColumn");
                    $crit_lookup_display = $this->getArrayElement($ci, "DisplayColumn");
                    $crit_criteria_display = $this->getArrayElement($ci, "OverviewColumn");

                    if ($crittp == "ANYCHAR") {
                        $crittp = "TEXTFIELD";
                    }

                    if ($critds == "ANYCHAR") {
                        $critds = "TEXTFIELD";
                    }

                    if ($critexp == "ANYCHAR") {
                        $critexp = "TEXTFIELD";
                    }

                    // Generate criteria lookup info unless its a link to a criteria in a nother report
                    if (!$linked_report && !($ciq = &$this->getArrayElement($ci, "Query"))) {
                        continue;
                    }

                    $critquery = new Reportico();

                    // Generate Criteria Query Columns
                    if (!$linked_report && ($ciqc = &$this->getArrayElement($ciq, "QueryColumns"))) {
                        foreach ($ciqc as $ccol) {
                            $in_query = true;
                            if (!$ccol["ColumnName"]) {
                                $in_query = false;
                            }

                            $critquery->createCriteriaColumn
                            (
                                $ccol["Name"],
                                $ccol["TableName"],
                                $ccol["ColumnName"],
                                $ccol["ColumnType"],
                                $ccol["ColumnLength"],
                                "###.##",
                                $in_query
                            );
                        }
                    }
                    // Generate Order By List
                    if (!$linked_report && ($coc = &$this->getArrayElement($ciq, "OrderColumns"))) {
                        // Generate QueryColumn for each column found
                        foreach ($coc as $col) {
                            $critquery->createOrderColumn
                            (
                                $col["Name"],
                                $col["OrderType"]
                            );
                        }
                    }

                    if (!$linked_report && ($as = &$this->getArrayElement($ciq, "Assignments"))) {
                        foreach ($as as $ast) {
                            if (array_key_exists("AssignName", $ast)) {
                                $critquery->addAssignment($ast["AssignName"], $ast["Expression"], $ast["Condition"]);
                            } else {
                                $critquery->addAssignment($ast["Name"], $ast["Expression"], $ast["Condition"]);
                            }

                        }
                    }

                    // Generate Criteria Links  In Array for later use
                    if (!$linked_report && ($cl = &$this->getArrayElement($ci, "CriteriaLinks"))) {
                        foreach ($cl as $clitem) {
                            $criteria_links[] = array(
                                "LinkFrom" => $clitem["LinkFrom"],
                                "LinkTo" => $clitem["LinkTo"],
                                "LinkClause" => $clitem["LinkClause"],
                            );
                        }
                    }

                    // Set Query SQL Text
                    if (!$linked_report) {
                        $critquery->table_text = $this->getArrayElement($ciq, "TableSql");
                        $critquery->where_text = $this->getArrayElement($ciq, "WhereSql");
                        $critquery->group_text = $this->getArrayElement($ciq, "GroupSql");
                        $critquery->sql_raw = $this->getArrayElement($ciq, "SQLRaw");
                        $critquery->rowselection = $this->getArrayElement($ciq, "RowSelection");
                    }
                    $critquery->setLookupReturn($crit_lookup_return);
                    $critquery->setLookupDisplay($crit_lookup_display, $crit_criteria_display);
                    $critquery->setLookupExpandMatch($critmatch);
                    $this->query->setCriteriaLookup($critnm, $critquery, $crittb, $critcl);
                    $this->query->setCriteriaInput($critnm, $crittp, $critds, $critexp, $crituse);
                    $this->query->setCriteriaLinkReport($critnm, $linked_report, $linked_report_item);
//echo "SET $critnm $crit_required<BR>";
                    $this->query->setCriteriaDefaults($critnm, $critdefault);
                    $this->query->setCriteriaList($critnm, $critlt);
                    //var_dump($crit_required);
                    $this->query->setCriteriaRequired($critnm, $crit_required);
                    $this->query->setCriteriaHidden($critnm, $crit_hidden);
                    $this->query->setCriteriaDisplayGroup($critnm, $crit_display_group);
                    //$this->query->setCriteriaHelp($critnm, $crithelp);
                    $this->query->setCriteriaAttribute($critnm, "column_title", $crittitle);

                    $this->query->setCriteriaHelp($critnm, $crithelp);

                } // End Criteria Item

                // Set up any Criteria Links
                foreach ($criteria_links as $cl) {
                    $this->query->set_criteria_link($cl["LinkFrom"], $cl["LinkTo"], $cl["LinkClause"]);
                }
            }
        }

    }
413767
public function loadAsXML()
    {
        $this->checkFileExists();
        $xml = new \DomDocument ();
        libxml_use_internal_errors(true);
        $result = $xml->load($this->absoluteFileName);
        if ($result) {
            return $xml;
        }
        $messageObject = ArrayUtil::getFromArray(libxml_get_errors(), 0);
        $libXMLMessage = ObjectUtil::getFromObject($messageObject, "message");
        $message = sprintf(self::EXCEPTION_INVALID_XML, $this->absoluteFileName, $libXMLMessage);
        $e = new \Exception(libxml_get_errors()[0]->message);
        libxml_clear_errors();
        throw $e;
    }
851527
public function to_xml() {
        $this->validate();
        foreach ($this->entries as $entry) {
            $entry->id = 'portfolio:' . $entry->id;
            $this->feed->appendChild($entry->to_dom($this->dom, $this->user));
        }
        return $this->dom->saveXML();
    }
557412
public function getXml(): string
    {
        $suites = $this->interpreter->flattenCases();
        $root = $this->getSuiteRoot($suites);
        foreach ($suites as $suite) {
            $snode = $this->appendSuite($root, $suite);
            foreach ($suite->cases as $case) {
                $cnode = $this->appendCase($snode, $case);
            }
        }

        return $this->document->saveXML();
    }
352166
protected function build()
    {
        $this->rawXml = $this->buildXML();

        $this->client->setDefaultOption('headers', array(
            'Content-Type' => 'application/x-www-form-urlencoded'
        ));

        $this->request = $this->client->post(null, null, array(
            "xml" => ($this->rawXml->saveXML())
        ));
    }
423903
protected function buildXml()
    {
        if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_RENAME)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
        }

        if (!isset($_GET["fileName"])) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
        }
        if (!isset($_GET["newFileName"])) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
        }

        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
        $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["fileName"]);
        $newFileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["newFileName"]);

        $oRenamedFileNode = new Ckfinder_Connector_Utils_XmlNode("RenamedFile");
        $this->_connectorNode->addChild($oRenamedFileNode);
        $oRenamedFileNode->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName));

        $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
        if (!$resourceTypeInfo->checkExtension($newFileName)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION);
        }

        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($newFileName) || $resourceTypeInfo->checkIsHiddenFile($newFileName)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
        }

        if (!$resourceTypeInfo->checkExtension($fileName, false)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if ($_config->forceAscii()) {
            $newFileName = CKFinder_Connector_Utils_FileSystem::convertToAscii($newFileName);
        }

        $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
        $newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $newFileName);

        $bMoved = false;

        if (!file_exists($filePath)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
        }

        if (!is_writable(dirname($newFilePath))) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
        }

        if (!is_writable($filePath)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
        }

        if (file_exists($newFilePath)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
        }

        $bMoved = @rename($filePath, $newFilePath);

        if (!$bMoved) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNKNOWN, "File " . CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName) . "has not been renamed");
        } else {
            $oRenamedFileNode->addAttribute("newName", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($newFileName));

            $thumbPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getThumbsServerPath(), $fileName);
            CKFinder_Connector_Utils_FileSystem::unlink($thumbPath);
        }
    }
582486
public function buildForReply()
    {
        if (!method_exists($this, 'toReply')) {
            throw new \Exception(__CLASS__.'未实现此方法：toReply()');
        }

        $base = array(
                 'ToUserName'   => $this->to,
                 'FromUserName' => $this->from,
                 'CreateTime'   => time(),
                 'MsgType'      => $this->getDefaultMessageType(),
                );

        return XML::build(array_merge($base, $this->toReply()));
    }
634045
protected function buildXml()
    {
        if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FOLDER_CREATE)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
        }

        $_resourceTypeConfig = $this->_currentFolder->getResourceTypeConfig();
        $sNewFolderName = isset($_GET["NewFolderName"]) ? $_GET["NewFolderName"] : "";
        $sNewFolderName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($sNewFolderName);
        if ($_config->forceAscii()) {
            $sNewFolderName = CKFinder_Connector_Utils_FileSystem::convertToAscii($sNewFolderName);
        }

        if (!CKFinder_Connector_Utils_FileSystem::checkFolderName($sNewFolderName) || $_resourceTypeConfig->checkIsHiddenFolder($sNewFolderName)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
        }

        $sServerDir = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $sNewFolderName);
        if (!is_writeable($this->_currentFolder->getServerPath())) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
        }

        $bCreated = false;

        if (file_exists($sServerDir)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
        }

        if ($perms = $_config->getChmodFolders()) {
            $oldUmask = umask(0);
            $bCreated = @mkdir($sServerDir, $perms);
            umask($oldUmask);
        }
        else {
            $bCreated = @mkdir($sServerDir);
        }

        if (!$bCreated) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
        } else {
            $oNewFolderNode = new Ckfinder_Connector_Utils_XmlNode("NewFolder");
            $this->_connectorNode->addChild($oNewFolderNode);
            $oNewFolderNode->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($sNewFolderName));
        }
    }
62401
protected function buildXml()
  {
    if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
    }

    if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
    }

    $oErrorsNode = new CKFinder_Connector_Utils_XmlNode("Errors");
    $errorCode = CKFINDER_CONNECTOR_ERROR_NONE;
    $deleted = 0;
    $oDeleteFilesNode = new Ckfinder_Connector_Utils_XmlNode("DeleteFiles");

    $currentResourceTypeConfig = $this->_currentFolder->getResourceTypeConfig();
    $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
    $_aclConfig = $_config->getAccessControlConfig();
    $aclMasks = array();
    $_resourceTypeConfig = array();
    $checkedPaths = array();

    if (!empty($_POST['files']) && is_array($_POST['files'])) {
      foreach ($_POST['files'] as $arr) {
        if (empty($arr['name'])) {
          continue;
        }
        if (!isset($arr['type'], $arr['folder'])) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        // file name
        $name = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($arr['name']);
        // resource type
        $type = $arr['type'];
        // client path
        $path = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($arr['folder']);

        if (!isset($_resourceTypeConfig[$type])) {
          $_resourceTypeConfig[$type] = $_config->getResourceTypeConfig($type);
        }

        if (is_null($_resourceTypeConfig[$type]) || !CKFinder_Connector_Utils_FileSystem::checkFileName($name) || preg_match(CKFINDER_REGEX_INVALID_PATH, $path)) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if (!$_resourceTypeConfig[$type]->checkExtension($name, false)) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if (empty($checkedPaths[$path])) {
          $checkedPaths[$path] = true;

          if ($_resourceTypeConfig[$type]->checkIsHiddenPath($path)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
          }
        }

        if ($currentResourceTypeConfig->checkIsHiddenFile($name)) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if (!isset($aclMasks[$type."@".$path])) {
          $aclMasks[$type."@".$path] = $_aclConfig->getComputedMask($type, $path);
        }

        $isAuthorized = (($aclMasks[$type."@".$path] & CKFINDER_CONNECTOR_ACL_FILE_DELETE) == CKFINDER_CONNECTOR_ACL_FILE_DELETE);
        if (!$isAuthorized) {
          $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
        }

        $filePath = $_resourceTypeConfig[$type]->getDirectory().$path.$name;

        if (!file_exists($filePath) || !is_file($filePath) ) {
          $errorCode = CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND;
          $this->appendErrorNode($oErrorsNode, $errorCode, $name, $type, $path);
          continue;
        }

        if ( !CKFinder_Connector_Utils_FileSystem::unlink($filePath) ){
          $errorCode = CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED;
          $this->appendErrorNode($oErrorsNode, $errorCode, $name, $type, $path);
          continue;
        } else {
          $deleted++;

          $thumbPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getThumbsServerPath(), $name);

          @unlink($thumbPath);
        }
      }
    }

    $this->_connectorNode->addChild($oDeleteFilesNode);
    if ($errorCode != CKFINDER_CONNECTOR_ERROR_NONE) {
      $this->_connectorNode->addChild($oErrorsNode);
    }
    $oDeleteFilesNode->addAttribute("deleted", $deleted);

    if ($errorCode != CKFINDER_CONNECTOR_ERROR_NONE) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_DELETE_FAILED);
    }
  }
944027
public function xml()
    {
        foreach ($this->_result as $disk_items) {
            if (isset($disk_items['Name']) && (trim($disk_items['Name']) !== '')) {
                $xmlstablebit_disk = $this->xml->addChild("Disk");
                foreach ($this->stablebit_items as $item) {
                    if (isset($disk_items[$item]) && (($itemvalue=$disk_items[$item]) !== '') &&
                    (($item !== 'SerialNumber') || (defined('PSI_PLUGIN_STABLEBIT_SHOW_SERIAL') && (PSI_PLUGIN_STABLEBIT_SHOW_SERIAL === true)))) {
                        $xmlstablebit_disk ->addAttribute($item, $itemvalue);
                    }
                }
            }
        }

        return $this->xml->getSimpleXmlElement();
    }
1169559
public function toXml()
    {
        $xml = new \SimpleXMLElement(
                '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><parser></parser>');
        
        $xml->addChild('fqdn', $this->fqdn);
        $xml->addChild('idn_fqdn', $this->idnFqdn);
        $xml->addChild('domain', $this->domain);
        $xml->addChild('idnDomain', $this->idnDomain);
        $xml->addChild('tld', $this->tld);
        $xml->addChild('idnTld', $this->idnTld);
        $xml->addChild('tldGroup', $this->tldGroup);
        $xml->addChild('validHostname', $this->validHostname);
        
        return $xml->asXML();
    }