Perhaps it could be moved to presence/lxml_utils.h ?