classes/phing/tasks/system/EchoProperties.php
protected function xmlSaveProperties(Properties $props, OutputStream $os)
    {
        $doc = new DOMDocument('1.0', 'UTF-8');
        $doc->formatOutput = true;
        $rootElement = $doc->createElement(self::$PROPERTIES);

        $properties = $props->getProperties();
        ksort($properties);
        foreach ($properties as $key => $value) {
            $propElement = $doc->createElement(self::$PROPERTY);
            $propElement->setAttribute(self::$ATTR_NAME, $key);
            $propElement->setAttribute(self::$ATTR_VALUE, $value);
            $rootElement->appendChild($propElement);
        }

        try {
            $doc->appendChild($rootElement);
            $os->write($doc->saveXML());
        } catch (IOException $ioe) {
            throw new BuildException("Unable to write XML file", $ioe);
        }
    }
protected function xmlSaveProperties(Properties $props, OutputStream $os)
    {
        $doc = new DOMDocument('1.0', 'UTF-8');
        $doc->formatOutput = true;
        $rootElement = $doc->createElement(self::$PROPERTIES);

        $properties = $props->getProperties();
        ksort($properties);
        foreach ($properties as $key => $value) {
            $propElement = $doc->createElement(self::$PROPERTY);
            $propElement->setAttribute(self::$ATTR_NAME, $key);
            $propElement->setAttribute(self::$ATTR_VALUE, $value);
            $rootElement->appendChild($propElement);
        }

        try {
            $doc->appendChild($rootElement);
            $os->write($doc->saveXML());
        } catch (IOException $ioe) {
            throw new BuildException("Unable to write XML file", $ioe);
        }
    }
protected function xmlSaveProperties ( Properties $ props , OutputStream $ os ) { $ doc = new DOMDocument ( '1.0' , 'UTF-8' ) ; $ doc -> formatOutput = true ; $ rootElement = $ doc -> createElement ( self :: $ PROPERTIES ) ; $ properties = $ props -> getProperties ( ) ; ksort ( $ properties ) ; foreach ( $ properties as $ key => $ value ) { $ propElement = $ doc -> createElement ( self :: $ PROPERTY ) ; $ propElement -> setAttribute ( self :: $ ATTR_NAME , $ key ) ; $ propElement -> setAttribute ( self :: $ ATTR_VALUE , $ value ) ; $ rootElement -> appendChild ( $ propElement ) ; } try { $ doc -> appendChild ( $ rootElement ) ; $ os -> write ( $ doc -> saveXML ( ) ) ; } catch ( IOException $ ioe ) { throw new BuildException ( "Unable to write XML file" , $ ioe ) ; } }
Output the properties as xml output.

@param  Properties $props the properties to save
@param  OutputStream $os the output stream to write to (Note this gets closed)
@throws BuildException
Output the properties as xml output .