Creating dynamic buttons-xml/php

I hope somebody can help me out;

I ve got a code which takes info (text and images out of a xml file that worls proper! Now what i want is this; There are multiple buttons which should me created automaticly when adding items. Also each button needs the same script to pull the (different) information out of the xml file. A php programmer takes care of the dynamicly created xml files.

Please help me out of this one…

My code sofar which works; (without buttons)

slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load(“reports/paris.xml”);
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
loadMovie(imagePath, targetClip);
slideText = newSlideNode.firstChild.nodeValue;
}
//
// Event handler for ‘Next slide’ button
next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
//
// Event handler for ‘Previous slide’ button
prev_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
} else {
currentIndex–;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
}

stop();