(raw_plan)
return to_native_string(ET.tostring(tree, encoding="UTF-8"))
Obfuscates SQL text & Parameters from the provided SQL Server XML Plan
    Also strips unnecessary whitespace
Obfuscates SQL text & Parameters from the provided SQL Server XML Plan
    Also strips unnecessary whitespace
Obfuscates SQL text & Parameters from the provided SQL Server XML Plan Also strips unnecessary whitespace
def obfuscate_xml_plan(raw_plan):
    """
    Obfuscates SQL text & Parameters from the provided SQL Server XML Plan
    Also strips unnecessary whitespace
    """
    tree = ET.fromstring(raw_plan)
    for e in tree.iter():
        if e.text:
            e.text = e.text.strip()
        if e.tail:
            e.tail = e.tail.strip()
        for k in XML_PLAN_OBFUSCATION_ATTRS:
            val = e.attrib.get(k, None)
            if val:
                e.attrib[k] = ensure_unicode(datadog_agent.obfuscate_sql(val))
    return to_native_string(ET.tostring(tree, encoding="UTF-8"))
def obfuscate_xml_plan ( raw_plan ) : tree = ET . fromstring ( raw_plan ) for e in tree . iter ( ) : if e . text : e . text = e . text . strip ( ) if e . tail : e . tail = e . tail . strip ( ) for k in XML_PLAN_OBFUSCATION_ATTRS : val = e . attrib . get ( k , None ) if val : e . attrib [ k ] = ensure_unicode ( datadog_agent . obfuscate_sql ( val ) ) return to_native_string ( ET . tostring ( tree , encoding = "UTF-8" ) )