Fix undefined method in XML elements