internet data handling and encoding element nodes an element node represents single xml element such as to get the text from an elementyou need to look for text nodes as children the following attributes and methods are defined to get other informatione tagname the tag name of the element for exampleif the element is defined by ''the tag name is 'fooe getelementsbytagname(tagnamereturns list of all children with given tag name getelementsbytagnamens(namespaceurilocalnamereturns list of all children with given tag name in namespace namespaceuri and localname are strings that specify the namespace and tag name if namespace has been declared using declaration such as '<foo xmlns:foo="'localname is set to 'barthe returned object is of type nodelist hasattribute(namereturns true if an element has an attribute with name name hasattributens(namespaceurilocalnamereturns true if an element has an attribute named by namespaceuri and localname the arguments have the same meaning as described for getelementsbytagnamens( getattribute(namereturns the value of attribute name the return value is string if the attribute doesn' existan empty string is returned getattributens(namespaceurilocalnamereturns the value of the attributed named by namespaceuri and localname the return value is string an empty string is returned if the attribute does not exist the arguments are the same as described for getelementsbytagnamens(text nodes text nodes are used to represent text data text data is stored in the data attribute of text object the text associated with given document element is always stored in text nodes that are children of the element utility functions the following utility methods are defined on nodes these are not part of the dom standardbut are provided by python for general convenience and for debugging toprettyxml([indent [newl]]creates nicely formatted string containing the xml represented by node and its children indent specifies an indentation string and defaults to tab ('\ 'newl specifies the newline character and defaults to '\nf lib fl ff