code: public static void validateXmlStructure(Document document, String encoding, EntityResolver resolver)
      throws CmsXmlException {
  
          // generate bytes from document
          byte[] xmlData = ((ByteArrayOutputStream)marshal(
              document,
              new ByteArrayOutputStream(512),
              encoding)).toByteArray();
          validateXmlStructure(xmlData, resolver);
      }
docs: Validates the structure of a XML document with the DTD or XML schema used
  by the document.<p>
  
  @param document a XML document that should be validated
  @param encoding the encoding to use when marshalling the XML document (required)
  @param resolver the XML entity resolver to use
  
  @throws CmsXmlException if the validation fails