Possible Duplicate:
SimpleXML how to prepend a child in a node?
My XML file is like this:
<?xml version="1.0"?>
<tt xmlns="http://www.w3.org/2006/10/ttaf1">
<body>
<div>
<p begin="00:00:12" end="00:00:13"></p>
</div>
</body>
</tt>
Now I want to add the following to the this file:
<p begin="00:00:25" end="00:00:25"></p>
I want to add this in the division element block. Can somebody give me a sample code to do this?