<p>I'm slowly getting back into PHP, and now I run into a problem, I want to install some web software on our host and I need to have either the latest Zend (which they don't have) or IonCube on the server and IonCube requires enable_dl to be on in the php.ini. Now a colleague of mine thinks I can update this via an .htaccess file on the server. So I created a s.htaccess on my machine as Windows doesn't like emptiness before the file extension. So I added the line php_flag enable_dl On to the file uploaded it and renamed the file to just .htaccess on the server. When I refresh the file is gone, when I keep it as s.htaccess it's fine but my php info still shows it as Off.</p>

<p>What n00b mistake am I making?</p>

The thing about stringbuilder is you're still trying to keep the entire contents in memory.  You want to only keep a small portion in memory at a time, and that means using filestreams.  Don't read an entire file into memory, open a stream on it and keep reading from the stream.
The problem with xml is that you can't just append them to each other:  you'll break the tag nesting.  So you need to know something about the structure of your xml files so that you can have an idea of what to do at each file boundry.
If you have something that works in theory with StringBuilder, but only fails in practice because of memory constraints, you should be able to translate the StringBuilder's .Append() and .AppendLine() method calls into .Write() and .WriteLine() calls for a filestream.