@lucidlips while I agree your solution is simple, I think data entered and set a non-published documents / post entry is not made public, it should not be pulled through as such.
I think the default should be published only. If a developer wants to change this a php template change should be made available for an override.
Just my 2 pennies..
Great code example btw!