@Override
	public void closeElement(ElementId elemId) throws IOException {
		depth -= 1;
		if (tagStatus == TAG_START) {
			buffer.append("/>");
			tagStatus = TAG_STOP;
			return;
		}
		if (tagStatus != TAG_CONTENT) {
			newLine();
		}
		else {
			tagStatus = TAG_STOP;
		}
		buffer.append("</");
		buffer.append(elemId.name());
		buffer.append('>');
	}
An XML based encoder
The underlying transfer encoding is an XML document.
The encoder is initialized with a StringBuilder which will receive the XML document as calls
are made on the encoder.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/XmlEncode.java