title: how to get a node name from an unknown node via SimpleXML
body: <p>For example I have 2 types of nodes in my xml file:</p>
  
  <pre><code>    1) &lt;book&gt;
      2) &lt;author&gt;
  </code></pre>
  
  <p>A variable named $node points to specific node(of unknown type).
  How can I access this node's name? It must be something like this:</p>
  
  <pre><code>    if($node-&gt;name()=="book")
      process_book($node);
      else
      process_author;
  </code></pre>