+2  A: 

If the XML is loaded via AJAX, then you'll need to apply the jQuery function on the element after it's loaded or using a live handler (depending on the event you are handling). If you attempt to apply it on page load without using a live handler, then the element doesn't yet exist and thus the selector won't match it and any handlers won't be applied.

tvanfosson
+3  A: 

The jQuery code may be running before your AJAX code finishes. Try the live function:
http://docs.jquery.com/Events/live

live() binds events to current and future elements that match a selector.

Frank DeRosa