libxml c

i have xml file like this

<root>
<sree>
<cnu value="cprogramming"\>
</sree>
</root>

to retrieve the valuse of cnu element i tried the following code
Code:

void
parseDoc() {

	xmlDocPtr doc;
	xmlNodePtr cur;

	doc = xmlParseFile("/usr/share/1.xml");
	
	if (doc == NULL ) {
		fprintf(stderr,"Document not parsed successfully. \n");
		return;
	}
	
	cur = xmlDocGetRootElement(doc);
	
	if (cur == NULL) {

		fprintf(stderr,"empty document\n");
		xmlFreeDoc(doc);
		return;
	}
	
	cur = cur->xmlChildrenNode;

	while (cur != NULL) {
		if ((!xmlStrcmp(cur->name, (const xmlChar *)"sree"))){
			parseStory (doc, cur);
		}
		 
	cur = cur->next;
	}
}
void
parseStory (xmlDocPtr doc, xmlNodePtr cur) {

	xmlChar *key;
	 cur = cur->xmlChildrenNode;

	while (cur != NULL) {
	    if ((!xmlStrcmp(cur->name, (const xmlChar *)"cnu "))) {
		    cur->name = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
		    printf("keyword: %s\n",cur->name);
		    //xmlFree();
 	    }
	cur = cur->next;
	}	
    return;
}

BUT my problem is when i print the value
iam getting null .
how can i retrieve the dataaa
thank u
sreee

I think you want to use xmlGetProp(cur, "version") instead of xmlNodeListGetString(). I think you want to be checking for "cnu" instead of "cnu " also.