function updateNode($node, $nodeID, $childNode, $cnodeValue, $xmlFile){
$dom = new DOMDocument();
$dom->load($xmlFile);
$node = $dom->getElementsByTagName($node);
foreach($node as $nodes){
if($nodes->getAttribute('id') == $nodeID){
$nodes->getElementsByTagName($childNode)->item(0)->nodeValue = $cnodeValue;
}
}
$dom->save($xmlFile);
}
if($_POST['update'] == 'Update'){
updateNode("listing", $_POST['id'], "price", $_POST['price'], $xmlfile);
updateNode("listing", $_POST['id'], "beds", $_POST['beds'], $xmlfile);
updateNode("listing", $_POST['id'], "baths", $_POST['baths'], $xmlfile);
updateNode("listing", $_POST['id'], "sqft", $_POST['sqft'], $xmlfile);
updateNode("listing", $_POST['id'], "year", $_POST['year'], $xmlfile);
updateNode("listing", $_POST['id'], "street", $_POST['street'], $xmlfile);
updateNode("listing", $_POST['id'], "city", $_POST['city'], $xmlfile);
updateNode("listing", $_POST['id'], "state", $_POST['state'], $xmlfile);
updateNode("listing", $_POST['id'], "zip", $_POST['zip'], $xmlfile);
}
This is all my handy work and wonder what other more experienced people would do instead.