def get_element_value(dom, tag):
    """ A simple helper function to fetch the text value of the first element found in an xml document """
    result = dom.getElementsByTagName(tag)
    if result:
        return result[0].firstChild.nodeValue