code: protected String setEncoding(String content, String encoding) {
  
          if (content.toLowerCase().indexOf("<?xml") == -1) {
              return content;
          } else {
              // XML information present, replace encoding
              // set the encoding only if it does not exist
              String xmlTag = content.substring(0, content.indexOf(">") + 1);
              if (xmlTag.toLowerCase().indexOf("encoding") == -1) {
                  content = content.substring(content.indexOf(">") + 1);
                  content = "<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>" + content;
              }
          }
          return content;
      }
docs: Sets the right encoding and returns the result.<p>
  
  @param content the filecontent
  @param encoding the encoding to use
  @return modified content