Add toCSSStyleSheet() and toXMLStyleSheet(), and use them.

We should avoid bare static_cast<>.

BUG=309516
TEST=none; no behavior changes.
R=haraken@chromium.org

Review URL: https://codereview.chromium.org/68313002

git-svn-id: svn://svn.chromium.org/blink/trunk@161713 bbb929c8-8fbe-4397-9dbb-9b2b20218538