def get_text(elem):
    """Get the xml text of a node, but formatted correctly"""

    # See if this is a double
    min_text = ''
    max_text = ''
    val_text = ''
    min_node = elem.find('min')
    if min_node is not None:
        min_text = ascii(min_node.text)
    max_node = elem.find('max')
    if max_node is not None:
        max_text = ascii(max_node.text)
    value_node = elem.find('value')
    if value_node is not None:
        val_text = ascii(value_node.text)

    if min_text and max_text and val_text:
        return ('<min>' + min_text + '</min>' +
                '<max>' + max_text + '</max>' +
                '<value>' + val_text + '</value>')

    return ascii(elem.text)