I think that pattern matching in a case like following could be more readable (in my opinion)
```erlang
case Elem of
    #xmlel{} ->
        gen_fsm:send_event(C2SPid, {xmlstreamelement, Elem});
    _ ->
        gen_fsm:send_event(C2SPid, Elem)
end
```