I am trying to print all the elements and attributes in an xml file. The xml file's contents are:
<topology>
<switch id="10">
<port no="1">h1</port>
<port no="2">h2</port>
</switch>
<tunnel id="91">
<port no="1">s1</port>
<port no="8">s8</port>
</tunnel>
</topology>
How do I do it? Also, how do I search for an element like switch inside topology?