//using namespace rapidxml;
EngineInfo::EngineInfo()
{       
    XmlDocument doc;
    XmlNode* decl = doc.allocate_node(rapidxml::node_declaration);
    decl->append_attribute(doc.allocate_attribute(L"version", L"1.0"));
    decl->append_attribute(doc.allocate_attribute(L"encoding", L"utf-8"));
    decl->append_attribute(doc.allocate_attribute(L"standalone", L"yes"));
    doc.append_node(decl);
    XmlNode* root = doc.allocate_node(rapidxml::node_element, L"EngineInfo");
    root->append_attribute(doc.allocate_attribute(L"version", L"1.0"));
    doc.append_node(root);

    XmlNode* resNodes = doc.allocate_node(rapidxml::node_element,L"SupportedResources");
    root->append_node(resNodes);
        
    // add supported 3d models.
    const wchar_t* modeltype = ResourceType::ToWString(ResourceType::Model);
    AddResNode(doc,resNodes,modeltype,L"Model",L"3d model",L".atgi,.dae");
        
    // add supported textures
    const wchar_t* textureType = ResourceType::ToWString(ResourceType::Texture);
    AddResNode(doc,resNodes,textureType,L"Texture",L"Texture file",L".dds,.bmp,.jpg,.png,.tga,.tif");

    // Add any other engine information 

    // print to string.
    rapidxml::print(back_inserter(m_data), doc, 0);   
}
// create node for resource type
void AddResNode(XmlDocument& doc,
    XmlNode* parent,
    const wchar_t* type,
    const wchar_t* name,
    const wchar_t* description,
    const wchar_t* fileExt)
{   
    XmlNode* resnode = doc.allocate_node(rapidxml::node_element,L"ResourceDescriptor");
    resnode->append_attribute(doc.allocate_attribute(L"Type", type));
    resnode->append_attribute(doc.allocate_attribute(L"Name", name));
    resnode->append_attribute(doc.allocate_attribute(L"Description", description));
    resnode->append_attribute(doc.allocate_attribute(L"Ext", fileExt));
    parent->append_node(resnode);
}