private void writeXml(Writer writer, QualityProfileDto profile, List<ActiveRule> activeRules) {
XmlWriter xml = XmlWriter.of(writer).declaration();
xml.begin("profile");
xml.prop("name", profile.getName());
xml.prop("language", profile.getLanguage());
xml.begin("rules");
for (ActiveRule activeRule : activeRules) {
xml.begin("rule");
xml.prop("repositoryKey", activeRule.key().ruleKey().repository());
xml.prop("key", activeRule.key().ruleKey().rule());