    document.addEventListener("DOMContentLoaded", function() {
                      try {
                        // Try to parse the XML using a hacky inline approach for diagnosis
                        const parser = new DOMParser();
                        const xmlDoc = parser.parseFromString(
                          `{{ submission.annotated_text.as_ref().unwrap() }}`,
                          "text/xml"
                        );
                        document.getElementById("parsed-structure")