nth of type, use libxmljs in tests