How can you use  XML_Serializer to generate XML with multiple levels ?

XML_Serializer seems really useful for  single level XML docs like:
<parent>
        <child/>
        <child/>
        <child/>
</parent

How can I get XML_Serializer to do something like the below ?
<parent>
        <child>
                <child/>
                <child>
                        <child/>
                        <child/>
                </child>
        </child>
</parent>
        

Or, is there something pre-existing that is better than XML_Serializer for multi-level XML ? I have built my own function to do this, but it is quite ugly and not as easy to reuse as I would like.
many thanks


My own query result looks similar to:
playlist_id, media_id
1                , 1
1                , 2
1                , 3
2                , 1
2                , 5
3                , 10


And this is what I need XML_Serializer to generate:
<query>
<playlists>
<playlist>
<meta><id>1</id></meta>
<content>
<spot><id>1</id></spot>
<spot><id>2</id></spot>
<spot><id>3</id></spot>
</content>
</playlist>
<playlist>
<meta><id>2</id></meta>
<content>
<spot><id>1</id></spot>
<spot><id>5</id></spot>
</content>
</playlist>
<playlist>
<meta><id>3</id></meta>
<content>
<spot><id>10</id></spot>
</content>
</playlist>
</playlists>
</query>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to