Writing to XML files with PHP

XML is really cool, I’m amazed at how easy it is to use and what it can achieve. But now I’m wondering about what the easiest method of adding data into an XML file via PHP is. I’m somewhat proficient with PHP (and MySQL), just not too much. For instance we have an XML file like so.


<news>
	<item>
		<heading>This is the heading!</heading>
		<content>Content! Blah blah blah blah blah blah blah!</content>
	</item>
	<item>
		<heading>This is the heading!</heading>
		<content>Content! Blah blah blah blah blah blah blah!</content>
	</item>
	<item>
		<heading>This is the heading!</heading>
		<content>Content! Blah blah blah blah blah blah blah!</content>
	</item>
</news>

So how would we go about adding item elements (of course containing headings and content) into our XML file via PHP? Are there any good libraries that do that or built in functions?