The printing unit of the Epson Workforce WF-2540 is fully supported by the OpenPrinting drivers up to a resolution of 5760×1440 dpi. It is recommended to use the driver epson-201211w, which is available in a 32bit and 64bit version as RPM and DEB file for download at OpenPrinting.
Until now, the scanner is not listed as supported device by XSane, but it can be used with the iscan drivers developed by Epson. At http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX one has to search for the Linux driver of the WF-2540 and download it.
Furthermore, the scanner of the Epson Workforce WF-2540 can also with the commercial program VueScan which is available for Linux.