Updated for modern CSS:
If you're working in one dimension, as with a phone view (where everything is basically vertical) or a navigation bar (where everything is basically horizontal), use the Flexible Box module.
Set your container to display: flex; and flex-flow: row; or column; depending on which way you're headed.
Justify-content:space-around; will space the child items evenly with roughly the same amount of space around the first and last item as there is between each two. If you want the first and last items flush against the container, use justify-content:space-between; instead.
Align-items: flex-start; will give you a left-hand margin if you're flowing down a column. If you're flowing across a row, you'll get your items lined up on a top margin. Align-items: center; will center your column or your row. Align-items: flex-end; will line up a column on the right, which is what you want if you're writing in an RTL language like Hebrew or Arabic, or sit all your row items on a bottom line.
If you're making a horizontal menu of text items, you might want to try align-items:baseline; and get all that type lined up on the actual baseline of the typeface you're using.
What if you're working in two dimensions?
Then use CSS-Grid!
Rachel Andrew, the editor of Smashing Magazine, and Jen Simmons, now at Apple and formerly a developer advocate at Mozilla, have together and separately published a ton of resources (and then I gave several WordCamp talks on what I learned from them.)
I can't tell you how happy I have been to ditch floats, in this old answer from nearly eight years ago, to the dustbin of history, except when I need to wrap type around a shape. But that's a topic for another day ...
--------------Answer from 2013---------
My preferred method, most of the time, is to put all the elements I want next to each other into a container and then float everything left. So I'm going to add a container class (I'm not a big fan of IDs - they're very limiting) to your styles and make a few edits:
.container {
float: left;
width: 800px;
}
#wrap {
float: left;
width:550px;
background-color:#fff;
margin:0 auto;
padding:0;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
}
#container {
width: 500px;
margin:0 auto;
padding: 25px;
font-size:.85em;
background-color: #fff;
}
.xyz {
float: left;
margin: 0 0 0 20px;
width: 200px;
}
This code will give you the .wrap div on the left and the .xyz class on the right, with a 20px margin between them, inside the .container class.
Not sure what you want to do with your #container ID, based on your assertion that you wanted to position .xyz next to .wrap.
If you'd really like to position #container in the same row with the other elements, float it left, too:
.container {
float: left;
overflow: auto;
width: 1330px;
}
#container {
float: left;
width: 500px;
margin:0 0 0 20px;
padding: 25px;
font-size:.85em;
background-color: #fff;
}
.xyz {
float: left;
margin: 0 0 0 20px;
width: 200px;
}
The container ID and the xyz class now each have a left margin of 20px, and the big container, the class, is wider than the sum of all the divs.
This is a method that's worked over and over for me building static sites and WordPress child themes (mostly based on the Genesis framework) since I started writing proper markup in 2007.