<p>The <code>.XFDL</code> file extension identifies <code>XFDL</code> Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.</p>

<p>I know how to view XFDL files using a file viewer I found <a href="http://web.archive.org/web/20170903022252/http://www.e-publishing.af.mil:80/viewerdownload.asp" rel="nofollow noreferrer">here</a>.  I can also modify and save these files by doing File:Save/Save As.  I'd like, however, to modify these files on the fly. Any suggestions? Is this even possible?</p>

<p>Update #1: I have now successfully decoded and unziped a <code>.xfdl</code> into an XML file which I can then edit. Now, I am looking for a way to re-encode the modified XML file back into base64-gzip (using Ruby or the command line)</p>

If the encoding is
base64
then this is the solution I've stumbled upon on the web:
"Decoding XDFL files saved with 'encoding=base64'.
Files saved with:
```
```
application/vnd.xfdl;content-encoding="base64-gzip"
```
```
are simple base64-encoded gzip files. They can be easily restored to XML by first decoding and then unzipping them. This can be done as follows on Ubuntu:
```
```
sudo apt-get install uudeview
uudeview -i yourform.xfdl
gunzip -S "" < UNKNOWN.001 > yourform-unpacked.xfdl
```
```
The first command will install uudeview, a package that can decode base64, among others. You can skip this step once it is installed.
Assuming your form is saved as 'yourform.xfdl', the uudeview command will decode the contents as 'UNKNOWN.001', since the xfdl file doesn't contain a file name. The '-i' option makes uudeview uninteractive, remove that option for more control.
The last command gunzips the decoded file into a file named 'yourform-unpacked.xfdl'.
Another
possible solution -
here
Side Note: Block quoted < code > doesn't work for long strings of code