parameters: (xml_str)
return_statement: return survey_data
docstring: 'xml_str' is a str object holding the XML of an XForm
      instance. Return a python object representation of this XML file.
docstring_summary: 'xml_str' is a str object holding the XML of an XForm
      instance. Return a python object representation of this XML file.
docstring_tokens: xml_str is a str object holding the XML of an XForm instance . Return a python object representation of this XML file .
function: def parse_xform_instance(xml_str):
      """
      'xml_str' is a str object holding the XML of an XForm
      instance. Return a python object representation of this XML file.
      """
      xml_obj = minidom.parseString(xml_str)
      root_node = xml_obj.documentElement
      # go through the xml object creating a corresponding python object
      # NOTE: THIS WILL DESTROY ANY DATA COLLECTED WITH REPEATABLE NODES
      # THIS IS OKAY FOR OUR USE CASE, BUT OTHER USERS SHOULD BEWARE.
      survey_data = dict(_path_value_pairs(root_node))
      assert len(list(_all_attributes(root_node))) == 1, \
          _(u"There should be exactly one attribute in this document.")
      survey_data.update({
          tag.XFORM_ID_STRING: root_node.getAttribute(u"id"),
          tag.INSTANCE_DOC_NAME: root_node.nodeName,
      })
      return survey_data
function_tokens: def parse_xform_instance ( xml_str ) : xml_obj = minidom . parseString ( xml_str ) root_node = xml_obj . documentElement # go through the xml object creating a corresponding python object # NOTE: THIS WILL DESTROY ANY DATA COLLECTED WITH REPEATABLE NODES # THIS IS OKAY FOR OUR USE CASE, BUT OTHER USERS SHOULD BEWARE. survey_data = dict ( _path_value_pairs ( root_node ) ) assert len ( list ( _all_attributes ( root_node ) ) ) == 1 , _ ( u"There should be exactly one attribute in this document." ) survey_data . update ( { tag . XFORM_ID_STRING : root_node . getAttribute ( u"id" ) , tag . INSTANCE_DOC_NAME : root_node . nodeName , } ) return survey_data