/** @hide */
  public void getXmlString(StringBuilder builder, Context context) {
    builder.append("<profile ");
    if (mNameResId > 0) {
      builder.append("nameres=\"");
      builder.append(context.getResources().getResourceEntryName(mNameResId));
    } else {
      builder.append("name=\"");
      builder.append(TextUtils.htmlEncode(getName()));
    }
    builder.append("\" uuid=\"");
    builder.append(TextUtils.htmlEncode(getUuid().toString()));
    builder.append("\">\n");

    builder.append("<statusbar>");
    builder.append(getStatusBarIndicator() ? "yes" : "no");
    builder.append("</statusbar>\n");

    for (ProfileGroup pGroup : profileGroups.values()) {
      pGroup.getXmlString(builder, context);
    }
    for (StreamSettings sd : streams.values()) {
      sd.getXmlString(builder, context);
    }
    for (ConnectionSettings cs : connections.values()) {
      cs.getXmlString(builder, context);
    }
    builder.append("</profile>\n");
    mDirty = false;
  }
 public String getXmlString() {
   StringBuilder builder = new StringBuilder();
   getXmlString(builder);
   return builder.toString();
 }