As far as I know, there aren't any 3rd party libraries that do that. You have two options:
a. Hand code the serialization/de-serialization for each object. It's pretty easy. To serialize, do something like:
QDomElement Asset::ToXMLNode(QDomDocument& doc)
{
QDomElement elem = doc.createElement("Asset");
elem.setAttribute("Image", ImageName);
elem.setAttribute("Name", Description);
elem.setAttribute("ID", ID);
elem.setAttribute("TargetClass", ClassType);
elem.setAttribute("Type", TypeToString());
QDomElement physEl = doc.createElement("Physics");
for(int i=0;i<BodyShapes.count();i++)
{
physEl.appendChild(BodyShapes[i]->ToXMLNode(doc));
}
elem.appendChild(physEl);
return elem;
}
To deserialize:
void Asset::Load(const QDomElement& node)
{
ImageName = node.attribute("Image");
Bitmap.load(GetResourceFolder() + QDir::separator() + ImageName);
Description = node.attribute("Name");
ID = node.attribute("ID");
ClassType = node.attribute("TargetClass");
QDomNodeList shapes = node.firstChildElement("Physics").childNodes();
for(int i=0;i<shapes.count();i++)
{
BodyShape* s = BodyShape::Load(shapes.item(i).toElement());
BodyShapes << s;
}
IsLoaded = true;
}
b. Clone QJSON and just rewrite the parts that emit JSON strings to emit XML strings and vise-versa. Should be about a day of work.