def get_from_dom(dom, name):
    """
    safely extract a field from a dom.
    return empty string on any failures.
    """
    try:
        fc = dom.getElementsByTagName(name)[0].firstChild
        if fc is None:
            return ''
        else:
            return fc.nodeValue
    except Exception as e:
        return ''