code: public String getXmlStart(Language lang, Language motherTongue) {
      StringBuilder xml = new StringBuilder(CAPACITY);
      xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
              .append("<!-- THIS OUTPUT IS DEPRECATED, PLEASE SEE http://wiki.languagetool.org/http-server FOR A BETTER APPROACH -->\n")
              .append("<matches software=\"LanguageTool\" version=\"" + JLanguageTool.VERSION + "\"" + " buildDate=\"")
              .append(JLanguageTool.BUILD_DATE).append("\">\n");
      if (lang != null || motherTongue != null) {
        String languageXml = "<language ";
        String warning = "";
        if (lang != null) {
          languageXml += "shortname=\"" + lang.getShortCodeWithCountryAndVariant() + "\" name=\"" + lang.getName() + "\"";
          String longCode = lang.getShortCodeWithCountryAndVariant();
          if ("en".equals(longCode) || "de".equals(longCode)) {
            xml.append("<!-- NOTE: The language code you selected ('").append(longCode).append("') doesn't support spell checking. Consider using a code with a variant like 'en-US'. -->\n");
          }
        }
        if (motherTongue != null && (lang == null || !motherTongue.getShortCode().equals(lang.getShortCodeWithCountryAndVariant()))) {
          languageXml += " mothertongueshortname=\"" + motherTongue.getShortCode() + "\" mothertonguename=\"" + motherTongue.getName() + "\"";
        }
        languageXml += "/>\n";
        xml.append(languageXml);
        xml.append(warning);
      }
      return xml.toString();
    }
docs: Get the string to begin the XML. After this, use {@link #ruleMatchesToXmlSnippet} and then {@link #getXmlEnd()}
  or better, simply use {@link #ruleMatchesToXml}.