I have a form that looks like this:
You have to send Labels within hidden inputs, etc:
and then in PHP you access pairs:
$name = "a"; // "s", "g", "d"
$tag = $_POST[$name.'_label'];
$value = $_POST[$name];
$xml_element = "<$tag>$value$tag>";
OR
use same name as label and then use:
foreach($_POST as $key => $value)
{
$xml_element = "<$key>$value$key>";
...
}