a. There are dslrs with built in HDR capability.
b. There are lens with special coating (eg.Pentax DA15) which yields pretty good results when shots directly at the sun.
c. Lastly can try polarizers (or even ND filters too).
Fill flash will not work since the background (especialy the second pic) unless it is within the range of the intended object.
#1 and #2 is achieveable straight out of camera without any editing
both are using small aperture
#1 -> meter at the branchs, with small aperture u'll get the sun though the sky will still be overblown
#2 -> wait till sunset, meter at the sky, u can see in the pic that there's somepart that's underexposed