static public void encodeNamespace(Encoder encoder, Namespace namespace,
			NameTransformer transformer) throws IOException {
		encoder.openElement(ELEM_PARENT);
		if (namespace != null) {
			ArrayList<Namespace> arr = new ArrayList<>();
			Namespace curspc = namespace;
			while (curspc != null) {
				arr.add(0, curspc);
				if (collapseToGlobal(curspc)) {
					break;		// Treat library namespace as root
				}
				curspc = curspc.getParentNamespace();
			}
			encoder.openElement(ELEM_VAL);	// Force global scope to have empty name
			encoder.closeElement(ELEM_VAL);
			for (int i = 1; i < arr.size(); ++i) {
				Namespace curScope = arr.get(i);
				encoder.openElement(ELEM_VAL);
				encoder.writeUnsignedInteger(ATTRIB_ID, curScope.getID());
				String nm = curScope.getName();
				String altName = transformer.simplify(nm);
				if (!nm.equals(altName)) {
					encoder.writeString(ATTRIB_LABEL, altName);
				}
				encoder.writeString(ATTRIB_CONTENT, nm);
				encoder.closeElement(ELEM_VAL);
			}
		}
		encoder.closeElement(ELEM_PARENT);
	}
Encode &lt;parent&gt; element to the stream describing the formal path elements
from the root (global) namespace up to the given namespace
@param encoder is the stream encoder
@param namespace is the namespace being described
@param transformer is used to computer the displayed version of each namespace
@throws IOException for errors in the underlying stream
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunction.java