hunt-xml 1.1.0-rc.7

A xml parsing library for D programming language.

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Build Status


A XML library for D Programming Language.


  • DOM parser: parse XML Document
  • DOM writer: to string and to file
  • Object serialization/deserialization


String parse/write

import hunt.xml;

void main()
    Document doc = Document.parse("<single-element attr1='one' attr2=\"two\"/>");
        auto node = doc.firstNode();
        writeln(node.getName()); // print single-element

File load/save

import hunt.xml;

void main()
	Document document = Document.load("resources/books.xml");"output.xml");

Simple object serialization/deserialization

abstract class GreetingSettingsBase {
    string city;
    string name = "HuntLabs";

class GreetingSettings : GreetingSettingsBase {

    int id = 1001;

    string color;

void objectToXml() {
	auto settings = new GreetingSettings; = "hunt";

	Document doc = toDocument(settings);
	writeln(doc.toString()); // print xml text
	writeln(doc.toPrettyString()); // print pretty xml text

void xmlToObject() {
	string text = `
	<Greeting ID='1003'>

	auto obj = toObject!(GreetingSettings)(text);
	assert( == 1003);
	assert( == "hunt");
	assert(obj.color == "Red");

Complex object serialization/deserialization

See SerializerTest.

    <GreetingBase ID='123'>
    <privateMember>private member</privateMember>
    <settings ID='1001' __metatype__='test.SerializerTest.GreetingSettings'>
            <name>name in base</name>
    <content>Hello, world!</content>
    <creationTime format='std'>637110507901821669</creationTime>
        <SysTime format='std'>637110507901821729</SysTime>
        <SysTime format='std'>637110507901821731</SysTime>
1.1.0-rc.7 2021-Nov-22
1.1.0-rc.6 2021-Nov-22
1.1.0-rc.5 2021-Apr-08
1.1.0-rc.2 2020-Nov-07
1.0.0-rc.7 2021-Nov-22
Show all 11 versions
Download Stats:
  • 0 downloads today

  • 2 downloads this week

  • 4 downloads this month

  • 301 downloads total

Short URL: