def get_node_val(node, val_type):
    """Return the value as a string of a child node of the specified type,
or raise ValueError if none exists"""
    for child in node.children:
        if child.expr_name == val_type:
            return child.text.strip('"')
    raise ValueError("No value of specified type.")