code: public String toXml(boolean pretty, boolean declaration, String... attributeNames) {
          StringBuilder sb = new StringBuilder();
  
          if(declaration) {
              sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              if (pretty) { sb.append('\n'); }
          }
          toXmlP(sb, pretty, "", attributeNames);
          return sb.toString();
      }
docs: Generates a XML document from content of this model.
  
  @param pretty pretty format (human readable), or one line text.
  @param declaration true to include XML declaration at the top
  @param attributeNames list of attributes to include. No arguments == include all attributes.
  @return generated XML.