Add API for serializing and escaping XML structures