or download this
print ($optional_filehandle, $optional_pretty_print_style)
...
Return the xml string for an entire element, including the tags. I
+f the optional second argument is true then only the string inside th
+e element is returned (the start and end tag for $elt are not). The t
+ext is XML-escaped: base entities (& and < in text, & < and " in attr
+ibute values) are turned into entities.