code: public static void addXmlDocumentAnnotationTo(final Node aNode, final String formattedDocumentation) {
  
          if (aNode != null && formattedDocumentation != null && !formattedDocumentation.isEmpty()) {
  
              // Add the new Elements, as required.
              final Document doc = aNode.getOwnerDocument();
              final Element annotation = doc.createElementNS(
                      XMLConstants.W3C_XML_SCHEMA_NS_URI, ANNOTATION_ELEMENT_NAME);
              final Element docElement = doc.createElementNS(
                      XMLConstants.W3C_XML_SCHEMA_NS_URI, DOCUMENTATION_ELEMENT_NAME);
              final CDATASection xsdDocumentation = doc.createCDATASection(formattedDocumentation);
  
              // Set the prefixes
              annotation.setPrefix(XSD_SCHEMA_NAMESPACE_PREFIX);
              docElement.setPrefix(XSD_SCHEMA_NAMESPACE_PREFIX);
  
              // Inject the formattedDocumentation into the CDATA section.
              annotation.appendChild(docElement);
              final Node firstChildOfCurrentNode = aNode.getFirstChild();
              if (firstChildOfCurrentNode == null) {
                  aNode.appendChild(annotation);
              } else {
                  aNode.insertBefore(annotation, firstChildOfCurrentNode);
              }
  
              // All Done.
              docElement.appendChild(xsdDocumentation);
          }
      }
docs: <p>Adds the given formattedDocumentation within an XML documentation annotation under the supplied Node.
  Only adds the documentation annotation if the formattedDocumentation is non-null and non-empty. The
  documentation annotation is on the form:</p>
  <pre>
  <code>
  &lt;xs:annotation&gt;
  &lt;xs:documentation&gt;(JavaDoc here, within a CDATA section)&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  </code>
  </pre>
  
  @param aNode                  The non-null Node to which an XML documentation annotation should be added.
  @param formattedDocumentation The documentation text to add.