Javascript to add xml nodes with forms

I need to make a simple admin page, just to add pictures to a simple image gallery. I want to make a simple form (heheh i use the word ‘simple’ too much :smiley: ) (name, upload picture & submit). And I’m stuck at the XML file. I want it to upload the picture and ti edit the XML file when i click submit, but I don’t know how to make that. I use PHP to upload the picture to the right place, but i can’t figure out how to edit the xml. I’m sorry for my very bad English and for bad sentence structure, I hope you understand me :smiley:

This is what the XML looks like :

<?xml version="1.0" encoding="UTF-8"?>

<juiceboxgallery 
	useFlickr="false"
	resizeOnImport="true"
	cropToFit="false"
	backgroundColor="rgba(221,231,255,50)"
	galleryHeight="100%"
	indexPageName="index.html"
>
  <image imageURL="images/slika5.png"
	thumbURL="thumbs/slika5.jpg"
	linkURL="images/slika5.png"
	linkTarget="_blank">
    <title><![CDATA[slika5]]></title>
    <caption><![CDATA[]]></caption>
  </image>
  <image imageURL="images/slika4.png"
	thumbURL="thumbs/slika4.jpg"
	linkURL="images/slika4.png"
	linkTarget="_blank">
    <title><![CDATA[slika4]]></title>
    <caption><![CDATA[]]></caption>
  </image>
  <image imageURL="images/slika3.png"
	thumbURL="thumbs/slika3.jpg"
	linkURL="images/slika3.png"
	linkTarget="_blank">
    <title><![CDATA[slika3]]></title>
    <caption><![CDATA[]]></caption>
  </image>
  <image imageURL="images/slika2.png"
	thumbURL="thumbs/slika2.jpg"
	linkURL="images/slika2.png"
	linkTarget="_blank">
    <title><![CDATA[slika2]]></title>
    <caption><![CDATA[]]></caption>
  </image>
  <image imageURL="images/slika1.png"
	thumbURL="thumbs/slika1.jpg"
	linkURL="images/slika1.png"
	linkTarget="_blank">
    <title><![CDATA[slika1]]></title>
    <caption><![CDATA[]]></caption>
  </image>
</juiceboxgallery>