If you're a newbie to programming, may I ask why you're using PHP? At the risk of triggering a flame war, I think there are better languages for doing web development these days.
As for how to generate XML from php, a google search for 'generate xml in php' should get you started.
cheers,
mick