public static String toYamlString(CNode rootNode) throws IOException {
        Node yamlRoot = ConfigurationAsCode.get().toYaml(rootNode);
        StringWriter buffer = new StringWriter();
        serializeYamlNode(yamlRoot, buffer);
        return buffer.toString();
    }
Converts a given {@code CNode} into a string.
<p>
Example usage:
<pre>{@code
ConfiguratorRegistry registry = ConfiguratorRegistry.get();
ConfigurationContext context = new ConfigurationContext(registry);
CNode yourAttribute = getUnclassifiedRoot(context).get("<your-attribute>");

String exported = toYamlString(yourAttribute);}</pre>

@param rootNode the {@code CNode} to convert to a string
@return a YAML string
@throws IOException if exporting to YAML fails
test-harness/src/main/java/io/jenkins/plugins/casc/misc/Util.java