This code converts a list to a tree to an etree. Expected a tree given a list