GXml is a project providing GObject bindings to libxml2 library. It is written in Vala, making easy to access it to any programming language supporting GObject Introspection.
Recently has gained a Serialization framework. They allow to provide .NET equivalent capabilities like write a XML representation of a GObject.
.NET have lots of features and there’s no a feature comparative, GXml Serialization framework provide following features:
- Provide a Serializable interface to provide user defined GObject to XML serialization
- Provide two Serializable implementations, but just SerializableObjectModel have been extensively tested and more XML/.NET oriented
- Allows to use Gee collections of Serializable objects
- Subclassing one of GXml’s Serializable implementations allows any GObject to be serializable in XML
This features are more flexible than .NET implementation, at least last time I visited. You can customize how your object will be serialized to XML; is not difficult to implement new Serializable implementations; you can use not just arrays, but any collection supported by GXml & Gee, making easy to store your objects in arrays, hash tables and dual key hash tables, and use that collection as a Serializable object property to be serialized to XML.
There are support for simple GObject properties like strings and integers. You can define an enumeration as a property and serialization framework will translate a string representation to XML for you using GLib/GObject enums introspections.
You can take control on XML node’s name and if a property will be a node’s property or a node’s text content.