Define xd_doc and xd_node structs in headers