private function addNewXmlElement(DOMDocument $dom, DOMElement $node, $name, $value)
    {
        $new = $dom->createElement($name);
        $new->appendChild($dom->createTextNode($value));
        $node->appendChild($new);
    }