title: C XML library for Embedded Systems
body: <p>I'm working on a project for an embedded system that's using XML for getting data into and out of the system. I don't want the XML handling to devolve into a bunch of bits that build XML strings using <code>snprintf()</code>/<code>strcat()</code> and friends or parse XML by counting "<code>&lt;</code>" and "<code>&gt;</code>" characters.</p>
  
  <p>I've found several XML libraries, a couple of which might even be small enough, but the closest they come to C is C++, which is not in the cards for this system.  I hoping I can find an XML library that meets the following constraints:</p>
  
  <ul>
  <li>C source code</li>
  <li>no dynamic memory allocation</li>
  <li>cheap.  Free is better, but copyleft won't do the trick.</li>
  </ul>
  
  <p>It doesn't have to be a full parser - I just want to be able to pull text out of nested elements and have a reasonably simple way to generate XML that doesn't rely on format strings. Attributes aren't being used (yet), so the library doesn't need to support them even.  The XML documents will be pretty small, so something that's DOM-like would be fine, as long as it'll work with client-provided buffers (parsing the raw XML in-place would be nice).</p>
  
  <p>PugXML and TinyXML look to be pretty close, but I'm hoping that someone out there knows about an XML lib tailored just for C-based embedded systems that my googling is missing.</p>