public static function setNodeText($dom_document, $node, $text)
    {
       /*
        * Clear existing child nodes
        */
        foreach($node->childNodes as $child_node)
        {
            $node->removeChild($child_node);
        }

       /*
        * Add a new child TextNode
        */
        return $node->appendChild($dom_document->createTextNode($text));
    }