I have the following XML element: <Content> <Controller Use="Context" Name="Base_Project_Maximum_Connections"> <DataTypes Use="Context"> <DataType Use="Target" Name="cs_dint" Family="NoFamily" Class="User"> <Members> <Member Name="Status" DataType="CONNECTION_STATUS" Dimension="0" Radix="NullType" Hidden="false" ExternalAccess="Read/Write" /> <Member Name="Data" DataType="DINT" Dimension="0" Radix="Decimal" Hidden="false" ExternalAccess="Read/Write" /> </Members> </DataType> </DataTypes> </Controller> </Content> I am trying to find all DataType elements that have a Name of "cs_dint" using the following code: def GetDataTypeFromElement(root, typeName = None): dataTypeIter = root.iter("DataType") for dataTypeElement in dataTypeIter: print ("Found a data type element") print ("Finished with first iteration") dataTypeIter = root.iter("DataType[@Name = 'cs_dint']") for dataTypeElement in dataTypeIter: print ("Found a data type element") print ("Finished with second iteration") return None The first call to iter(), where I merely look for DataType elements, works. The second, where I try to specify the name, doesn't. Why not? Continue reading...