code: protected function getAttribute(SimpleXmlElement $node, $name)
      {
          $attributes = $node->attributes();
  
          return (string) $attributes[$name];
      }
docs: Gets attribute value.
  
  @param SimpleXMLElement $node The instance of SimpleXMLElement
  @param string           $name The name of attribute
  
  @return string