toXml method

XMLNode toXml()

Implementation

XMLNode toXml() {
  return XMLNode.xmlns(
    tag: 'query',
    xmlns: discoInfoXmlns,
    attributes: node != null
        ? <String, String>{
            'node': node!,
          }
        : <String, String>{},
    children: [
      ...identities.map((identity) => identity.toXMLNode()),
      ...features.map(
        (feature) => XMLNode(
          tag: 'feature',
          attributes: {
            'var': feature,
          },
        ),
      ),
      if (extendedInfo.isNotEmpty) ...extendedInfo.map((ei) => ei.toXml()),
    ],
  );
}