internet data handling and encoding locate elementsyou have to navigate through the document hierarchy starting at the root element xml dom minidom the xml dom minicom module provides basic support for parsing an xml document and storing it in memory as tree structure according to the conventions of dom there are two parsing functionsparse(file [parser]parses the contents of file and returns node representing the top of the document tree ile is filename or an already-open file object parser is an optional sax -compatible parser object that will be used to construct the tree if omitteda default parser will be used parsestring(string [parser]the same as parse()except that the input data is supplied in string instead of file nodes the document tree returned by the parsing functions consists of collection of nodes linked together each node has the following attributes which can be used to extract information and navigate through the tree structurenode attribute description attributes childnodes firstchild lastchild localname mapping object that holds attribute values (if anya list of all child nodes of the first child of node the last child of node local tag name of an element if colon appears in the tag (for example'')then this only contains the part after the colon namespace associated with nif any the node that appears after in the tree and has the same parent is none if is the last sibling the name of the node the meaning depends on the node type integer describing the node type it is set to one of the following values which are class variables of the node classattribute_nodecdata_section_nodecomment_nodedocument_fragment_nodedocument_nodedocument_type_nodeelement_nodeentity_nodeentity_reference_nodenotation_nodeprocessing_instruction_nodeor text_node the value of the node the meaning depends on the node type reference to the parent node part of tag name that appears before colon for examplethe element 'would have prefix of 'foothe node that appears before in the tree and has the same parent namespaceuri nextsibling nodename nodetype nodevalue parentnode prefix previoussibling lib fl ff