A.I Responses - Writing/Loading From A Remote XML Document!

Hey guys, im a bit rusty on flash as ive not used it in so long. Im using Flash 8 (Obv, since im posting in this forum:mario: ) and have the intention of creating a small game where the user will ask the “Artifical Intelligence” questions by typing them into an input box, the AI will then respond based on the question.

Im not trying any super-advanced sub stringing of user inputted questions to pick out different clues as to what to respond, I just want a response based on the exact question asked like the following:

User - "Where do you live"

*Checks for “Where do you live” in XML document

Loads the response for displaying in a dynamic textbox inside the flash.

A.I - "I live in your cupboard"

Thats reading from an XML document, but i would also like to know how to write to the same xml document (located in the same location as the .swf on a website) so the user has the opportunity to add his/her own questions/responses to the A.I effectively building up a smart little system.

Hope ive not been too confusing :wink:

EDIT: If its easier to do this using PHP, thats fine, I would just like to learn how to :slight_smile: