How to use TinyXml to parse for a specific element
I would like to parse a group of elements out of a TinyXml output. Essentially, I need to pick out any port element's "portid" attribute of the port has a state of "open" (shown below for port 23). What's the best way to do this? Here's the (simplified) listing for the output from TinyXml: <?xml version="1.0" ?> <nmaprun> <host> <ports> <port protocol="tcp" portid="22"> <state state="filtered"/> </port> <port protocol="tcp" portid="23"> <state state="open "/> </port> <port protocol="tcp" portid="24"> <state state="filtered" /> </port> <port protocol="tcp" portid="25"> <state state="filtered" /