renders this object as MusicXML

@return string MusicXML representation of the object
181987
function toMusicXML() {
		  $out  = '<direction placement="'.$this->placement.'">';
		  $out .= '<direction-type>';

		  $out .= $this->direction->toMusicXML();

		  $out .= '</direction-type>';
		  $out .= '<staff>'.$this->staff.'</staff>';
		  // TODO put the sound elements in here too
		  $out .= '</direction>';

		/*
			<direction placement="above">
			<direction-type>
			<metronome parentheses="no">
			<beat-unit>quarter</beat-unit>
			<per-minute>125</per-minute>
			</metronome>
			</direction-type>
			<staff>1</staff>
			<sound tempo="125"/>
			</direction>

			<direction placement="below">
			<direction-type>
			<dynamics>
			<p/>
			</dynamics>
			</direction-type>
			<staff>1</staff>
			<sound dynamics="54.44"/>
			</direction>


		*/
		return 'it works!';
  }
819106
public function generateXml()
    {
        $xml = $this->getUpdate()->asSimplexml();
        $removeInstructions = $xml->xpath("//remove");
        if (is_array($removeInstructions)) {
            foreach ($removeInstructions as $infoNode) {
                /** @var Mage_Core_Model_Layout_Element $infoNode */
                if (!$this->checkConditionals($infoNode, false)) {
                    continue;
                }
                $blockName = trim((string)$infoNode['name']);
                if ($blockName) {
                    $ignoreNodes = $xml->xpath("//block[@name='" . $blockName . "'] | //reference[@name='" . $blockName . "']");
                    if (is_array($ignoreNodes)) {
                        foreach ($ignoreNodes as $ignoreNode) {
                            /** @var Mage_Core_Model_Layout_Element $ignoreNode */
                            $ignoreNode['ignore'] = true;
                        }
                    }
                }
            }
        }
        $this->setXml($xml);
        return $this;
    }
455553
protected function render()
    {
        if ($this->mobile !== null || $this->tablet !== null) {
            if (($this->mobile === false && Container::getDevice()->isMobile())
            ||  ($this->tablet === false && Container::getDevice()->isMobileOrTablet())) {
                return '';
            }
            if (($this->mobile === true && !Container::getDevice()->isMobile())
            ||  ($this->tablet === true && !Container::getDevice()->isMobileOrTablet())) {
                $this->addCssClass('visible-xs-inline');
            }
            else if (($this->mobile === false || $this->tablet === false) 
            &&  !Container::getDevice()->isMobileOrTablet()) {
                $this->addCssClass('hidden-xs');
            }
        }
        $this->content .= $this->getHtml();
        $this->lines = [];
        if ($this->mobileCrop && $this->mobileCrop !== self::CROP_AUTO) {
            $croppedContent = T::crop($this->content, $this->mobileCrop);
            if (Container::getDevice()->isMobile()) {
                $content = $this->escape ? $this->esc($croppedContent) : $croppedContent;
                unset($croppedContent);
            } else {
                $content = $this->escape ? $this->esc($this->content) : $this->content;
                $this->addCssClass('hidden-xs');
                $croppedContent = $this->escape ? $this->esc($croppedContent) : $croppedContent;
            }
        }
        if (!isset($content)) {
            $content = $this->escape ? $this->esc($this->content) : $this->content;
        }
        if ($this->mobileCrop === self::CROP_AUTO) {
            $this->addCssClass('text-overflow');
        }
        $this->setAttributes($this->getTooltipAttributes());
        $this->setAttributes($this->getPopoverAttributes());
        $this->addCssClasses($this->getMenuCssClasses());
        $this->setAttributes($this->getMenuAttributes());
        $menuOrientation = $this->menu ? ' ' . $this->menu->getOrientationClass() : '';
        if (!$this->elt && $this->getAttributes()) {
            $this->setElement('span');
        }
        $this->elt !== '' && $this->html('<' . $this->elt . $this->getEltDecorationStr() . '>');
        $this->html($content);
        $this->elt !== '' && $this->html('</' . $this->elt . '>');
        if (isset($croppedContent)) {
            $this->removeCssClass('hidden-xs');
            $this->addCssClass('visible-xs-inline');
            $this->html('<' . $this->elt . $this->getEltDecorationStr() . '>');
            $this->html($croppedContent);
            $this->html('</' . $this->elt . '>');
        }
        $html = $this->getHtml();
        if ($this->menu) {
            $html = $this
                ->html('<div class="inline dropdown clickable' . $menuOrientation . '">')
                ->html($html)
                ->html((string) $this->menu)
                ->html('</div>')
                ->getHtml();
        }
        
        return $html;
    }
766174
function toMusicXML($num) {
        $out = '';

        $out .= '<clef number="'.$num.'">';
        $out .= '<sign>'.$this->sign.'</sign>';
        $out .= '<line>'.$this->line.'</line>';
        if ($this->octaveChange != 0) {
            $out .= '<clef-octaveChange>'.$this->octave-change.'</clef-octaveChange>';
        }
        $out  .= '</clef>';

        return $out;
    }
114688
function toMusicXML() {
        $out  = '';
        $out .= '<tuplet';
        $out .= ' bracket="'.$this->bracket.'"';
        $out .= ' number="'.$this->number.'"';
        $out .= ' placement="'.$this->placement.'"';
        $out .= ' type="'.$this->type.'"';
        $out .= '/>';
        return $out;
    }
1347806
public function readXMLString() {

            $strref = $this->readU29();

            $strlen = $strref >> 1; 
            $str = $this->stream->readBuffer($strlen);
            return simplexml_load_string($str);

        }
554682
public function render()
    {
        $selfClosingTags = [
            'area',
            'base',
            'br',
            'col',
            'command',
            'embed',
            'hr',
            'img',
            'input',
            'keygen',
            'link',
            'meta',
            'param',
            'source',
            'track',
            'wbr',
        ];

        if (in_array($this->tagName, $selfClosingTags)) {
            $attr = $this->attributes;
            unset($attr[ 'realpath' ]);

            if ($this->hasAttributes()) {
                return '<' . $this->tagName . ' ' . trim($this->attributes->__toString()) . '>';
            }

            return '<' . $this->tagName . '>';
        } else {
            $output[] = $this->open();

            if ($this->hasTextContent()) {
                $output[] = PHP_EOL . implode('', $this->textContent->getArrayCopy()) . PHP_EOL;
            }

            if ($this->hasChildNodes()) {
                if ( ! $this->hasTextContent()) {
                    $output[] = PHP_EOL;
                }

                foreach ($this->childNodes as $childNode) {
                    $output[] = $childNode . PHP_EOL;
                }
            }
        }

        $output[] = $this->close();

        return implode('', $output);
    }
198184
public function toXML()
    {
        $xml = '<image:image>';

        $xml .= '<image:loc>' . Utils::encode($this->getLoc()) . '</image:loc>';

        if ($this->getCaption()) {
            $xml .= '<image:caption>' . Utils::render($this->getCaption()) . '</image:caption>';
        }

        if ($this->getGeoLocation()) {
            $xml .= '<image:geo_location>' . Utils::render($this->getGeoLocation()) . '</image:geo_location>';
        }

        if ($this->getTitle()) {
            $xml .= '<image:title>' . Utils::render($this->getTitle()) . '</image:title>';
        }

        if ($this->getLicense()) {
            $xml .= '<image:license>' . Utils::render($this->getLicense()) . '</image:license>';
        }

        $xml .= '</image:image>';

        return $xml;
    }
413863
public function toString()
        {
            if ($this->void) {
                return '<'.$this->tag.$this->createAttributes().' />';
            } else {
                return '<'.$this->tag.$this->createAttributes().'>'.$this->recursivelyStringify($this->content).'</'.$this->tag.'>';
            }
        }
667795
function toMusicXML() {
        $out    = '';
        $out   .= '<time-modification>';
          $out .= '<actual-notes>'.$this->actualNotes.'</actual-notes>';
          $out .= '<normal-notes>'.$this->normalNotes.'</normal-notes>';
        $out   .= '</time-modification>';
        return $out;
    }
999261
public function render()
    {
        $xml = new SimpleXMLElement(
            '<?xml version="1.0" encoding="UTF-8" ?>
            <rss version="2.0"
                xmlns:content="http://purl.org/rss/1.0/modules/content/"
                xmlns:wfw="http://wellformedweb.org/CommentAPI/"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:atom="http://www.w3.org/2005/Atom"
                xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
                xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
            />',
            LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL
        );

        foreach ($this->channels as $channel) {
            $toDom = dom_import_simplexml($xml);
            $fromDom = dom_import_simplexml($channel->asXML());
            $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));
        }

        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($dom->importNode(dom_import_simplexml($xml), true));
        $dom->formatOutput = true;

        return $dom->saveXML();
    }
352680
function toMusicXML() {
        $out  = '';
        $out .= '<slur';
        if (!empty($this->number)) {
	        $out .= ' number="'.$this->number.'"';
        }
        if (!empty($this->placement)) {
	        $out .= ' placement="'.$this->placement.'"';
	    }
        if (!empty($this->type)) {
	        $out .= ' type="'.$this->type.'"';
	    }
        if (!empty($this->bezierX)) {
	        $out .= ' bezier-x="'.$this->bezierX.'"';
	    }
        if (!empty($this->bezierY)) {
	        $out .= ' bezier-y="'.$this->bezierY.'"';
	    }
        if (!empty($this->defaultX)) {
	        $out .= ' default-x="'.$this->defaultX.'"';
	    }
        if (!empty($this->defaultY)) {
	        $out .= ' default-y="'.$this->defaultY.'"';
	    }

        $out .= '/>';
        return $out;
    }
1302168
public function toString()
    {
        if (empty($this->stringRepresentation)) {
            $this->stringRepresentation = sprintf('%s%s_%s', static::MESSAGE_TO_STRING_PREFIX, $this->getSourceId(), $this->getResourceId());
        }
        return $this->stringRepresentation;
    }
867328
public function toString()
    {
        $query = '';

        if ($this->sql) {
            return $this->sql;
        }

        switch ($this->type) {
            case 'element':
                $query .= (string) $this->element;
                break;

            case 'select':
                $query .= (string) $this->select;
                $query .= (string) $this->from;

                if ($this->join) {
                    // Special case for joins
                    foreach ($this->join as $join) {
                        $query .= (string) $join;
                    }
                }

                if ($this->where) {
                    $query .= (string) $this->where;
                }

                if ($this->group) {
                    $query .= (string) $this->group;
                }

                if ($this->having) {
                    $query .= (string) $this->having;
                }

                if ($this->order) {
                    $query .= (string) $this->order;
                }

                break;

            case 'union':
                $query .= (string) $this->union;
                break;

            case 'delete':
                $query .= (string) $this->delete;
                $query .= (string) $this->from;

                if ($this->join) {
                    // Special case for joins
                    foreach ($this->join as $join) {
                        $query .= (string) $join;
                    }
                }

                if ($this->where) {
                    $query .= (string) $this->where;
                }

                break;

            case 'update':
                $query .= (string) $this->update;

                if ($this->join) {
                    // Special case for joins
                    foreach ($this->join as $join) {
                        $query .= (string) $join;
                    }
                }

                $query .= (string) $this->set;

                if ($this->where) {
                    $query .= (string) $this->where;
                }

                break;

            case 'insert':
                $query .= (string) $this->insert;

                // Set method
                if ($this->set) {
                    $query .= (string) $this->set;
                } elseif ($this->values) {
                    // Columns-Values method
                    if ($this->columns) {
                        $query .= (string) $this->columns;
                    }

                    $elements = $this->values->getElements();

                    if (!($elements[0] instanceof $this)) {
                        $query .= ' VALUES ';
                    }

                    $query .= (string) $this->values;
                }

                break;

            case 'call':
                $query .= (string) $this->call;
                break;

            case 'exec':
                $query .= (string) $this->exec;
                break;
        }

        // Process Limit
        $query = $this->processLimit($query, $this->limit, $this->offset);

        if ($this->suffix) {
            $query .= ' ' . (string) $this->suffix;
        }

        if ($this->type === 'select' && $this->alias !== null) {
            $query = sprintf('(%s) AS %s', $query, $this->alias);
        }

        return $query;
    }
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();
    }
256754
public function getMetaData(): string
    {
        return Helper::createMetaDataXml($this->itemId, "-1", [
            "res"               =>  $this->uri,
            "upnp:albumArtURI"  =>  $this->albumArt,
            "dc:title"          =>  $this->title,
            "upnp:class"        =>  "object.item.audioItem.musicTrack",
            "dc:creator"        =>  $this->artist,
            "upnp:album"        =>  $this->album,
        ]);
    }
1065114
public function ToString()
	{
		if ( is_null( $this->domNode ) ) return "";
		if ( $this->domNode instanceof \DOMDocument )
		{
			$result = $this->domNode->saveXML( null );
			// Remove any initial PI
			$result = preg_replace( "/^<\?xml.*\?>\s/", "", $result );
			return $result;
		}
		else
		{
			// InnerXml?
			// return array_reduce(
			// 	iterator_to_array( $this->domNode->childNodes ),
			// 	function ( $carry, /** @var \DOMNode */ $child )
			// 	{
			// 		return $carry.$child->ownerDocument->saveXML( $child );
			// 	}
			// );
			$result = $this->domNode->ownerDocument->SaveXML( $this->domNode );
			return $result;
		}
	}