toXml method

XmlNode toXml()

Implementation

XmlNode toXml() {
  var attributes = <XmlAttribute>[];
  attributes.add(XmlAttribute(XmlName('name'), name));
  attributes.add(XmlAttribute(XmlName('type'), type.value));
  if (access == DBusPropertyAccess.readwrite) {
    attributes.add(XmlAttribute(XmlName('access'), 'readwrite'));
  } else if (access == DBusPropertyAccess.read) {
    attributes.add(XmlAttribute(XmlName('access'), 'read'));
  } else if (access == DBusPropertyAccess.write) {
    attributes.add(XmlAttribute(XmlName('access'), 'write'));
  }
  return XmlElement(XmlName('property'), attributes,
      annotations.map((a) => a.toXml()).toList());
}