Parse child value from XML using ezxml
ezxml has a variadic function which allows you to traverse directly to a specific node, terminated by either -1 as the index, or an empty string for the node name:

pxUpnpSubChild  = ezxml_get(pxUpnp, "device", 0, "friendlyName", 0, "");


This would give you directly the first friendlyName node of the first device node. Internally, it does mostly the same as what you did manually.



The more elegant solution would to use standard XPath expressions, however that isn't supported by ezxml. Libraries for C supporting XPath would e.g. libxml2 or Expat