toXml method

XmlNode toXml()

Implementation

XmlNode toXml() {
  final builder = XmlBuilder();
  builder.element(
    'RoutingRule',
    nest: () {
      if (condition != null) {
        builder.element(
          'Condition',
          nest: (condition!.toXml() as XmlDocument).rootElement.children,
        );
      }

      if (redirect != null) {
        builder.element(
          'Redirect',
          nest: (redirect!.toXml() as XmlDocument).rootElement.children,
        );
      }
    },
  );
  return builder.buildDocument();
}