You don't tell us what error message you get or how you used ->registerNs to register your namespace.
I've used XML::LibXML with namespaces and ->findnodes and I'm fairly certain that they work. Maybe the problem is your XPath expression - doc is different from foo:doc, if foo is the namespace urn:foo:names:tc:doc:document:1.2 where the doc element lives in. Maybe changing your XPath query to the following will make things work if you specify the namespaces for each node not in th edefault namespace:
/foo:doc/body/node