thinking about the comments zeuxcg I could figure out what was wrong.
pugi::xml_node xclient = xjack.child(sclient.c_str());
is looking up for a child with name "something" that really doesn't exists, what I'm looking for is a tag with name "client" and attribute "name" with value of "something".
So, the correct is:
pugi::xml_node xclient = xjack.find_child_by_attribute("client", "name", sclient.c_str());
if (!xclient) {
xclient = xjack.append_child("client");
xclient.append_attribute("name").set_value(sclient.c_str());
}