Code Formatting with Komodo IDE

How many times have you copied a large chunk of HTML or XML from a web page or software application and pasted it into Komodo IDE, only to find that it's either all on one line or not indented properly, and thus a nightmare to read? What about if you need to ensure your CSS or JavaScript code is formatted properly before you commit it? How can you ensure your Python code is correctly indented?