def to_xml
      xml = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
'
      each_pair do |k, _v|
        xml += "<node name=\"#{k}\" />"
      end
      if @object
        @object.intfs.each_pair do |_k, v|
          xml += %(<interface name="#{v.name}">\n)
          v.methods.each_value { |m| xml += m.to_xml }
          v.signals.each_value { |m| xml += m.to_xml }
          xml += "</interface>\n"
        end
      end
      xml += "</node>"
      xml
    end
def to_xml
      xml = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
'
      each_pair do |k, _v|
        xml += "<node name=\"#{k}\" />"
      end
      if @object
        @object.intfs.each_pair do |_k, v|
          xml += %(<interface name="#{v.name}">\n)
          v.methods.each_value { |m| xml += m.to_xml }
          v.signals.each_value { |m| xml += m.to_xml }
          xml += "</interface>\n"
        end
      end
      xml += "</node>"
      xml
    end
Create a new node with a given _name_.
 Return an XML string representation of the node.
 It is shallow, not recursing into subnodes