docs: protected CmsPair<String, String> decode(CmsFile file) throws CmsException {
  
          String content = null;
          String encoding = getConfiguredEncoding(m_cms, file);
          I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(file.getTypeId());
          if (resType instanceof CmsResourceTypeJsp) {
              content = decode(file.getContents(), encoding);
          } else {
              try {
                  CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(m_cms);
                  // parse the XML and serialize it back to  a string with the configured encoding
                  Document doc = CmsXmlUtils.unmarshalHelper(file.getContents(), resolver);
                  content = CmsXmlUtils.marshal(doc, encoding);
              } catch (Exception e) {
                  // invalid xml structure, just use the configured encoding
                  content = decode(file.getContents(), encoding);
              }
          }
          return CmsPair.create(content, encoding);
      }