public void toXML(XMLWriter xmlWriter, int indent, boolean relative)
  throws IOException {
    xmlWriter.printXMLStartTag(constantXMLTag, indent, relative, true);
    int subIndent = indentLength;
    if (guid != null) {
      guid.toXML(xmlWriter, subIndent, true);
      subIndent = 0;
    }
    if (name != null) {
      xmlWriter.printXMLStartTag(nameXMLTag, subIndent, true, false);
      xmlWriter.print(TextUtil.doEntityReference(this.getName()));
      xmlWriter.printXMLEndTag(nameXMLTag);
      if (subIndent == indentLength)
        subIndent = 0;
    }
    xmlWriter.printXMLEndTag(constantXMLTag, -indentLength, true);
  }