using web services it is important to include all parent level elements in the findall statement except for the top level element ( users/userotherwisepython will not find any desired nodes import xml etree elementtree as et input '' chuck brent ''stuff et fromstring(inputlst stuff findall('users/user'print('user count:'len(lst)lst stuff findall('user'print('user count:'len(lst )lst stores all user elements that are nested within their users parent lst looks for user elements that are not nested within the top level stuff element where there are none user count user count javascript object notation json the json format was inspired by the object and array format used in the javascript language but since python was invented before javascriptpython' syntax for dictionaries and lists influenced the syntax of json so the format of json is nearly identical to combination of python lists and dictionaries here is json encoding that is roughly equivalent to the simple xml from above"name"chuck""phone"type"intl""number"+