What is a good way to structure mark-up generating code and avoid the example mess? Here are two methods of code that only vary in one place. Specifically, the first method calls GetReleaseYear(), and the second calls GetReleaseDate().

This is one example of a one-line difference in multiple methods, and each time the difference might be on a different line or couple of lines. One possible design I've considered is passing in a list of strings to a function, but this is cumbersome because the lists would still need to be prepared, and the generated HTML still has to be somewhat content-aware.

private string A()
    {
        string title = GetTitle();
        string mediaType = GetMediaType();
        string description = GetDescription();
        string releaseYear = GetReleaseYear();
        string contributors = GetContributors();
        string image = GetImage();
        string genres = GetGenres();
        string ratings = GetRatings();

        string top = string.Format("{0}This is a {1}{2}.&lt;br&gt;&lt;br&gt;",
                title, mediaType, string.IsNullOrEmpty(releaseYear) ? string.Empty
                : " released in " + releaseYear);

        StringBuilder metadata = new StringBuilder();
        metadata.AppendLine(contributors + "&lt;br&gt;");
        metadata.AppendLine(genres + "&lt;br&gt;&lt;br&gt;");
        metadata.AppendLine(ratings + "&lt;br&gt;&lt;br&gt;");
        metadata.AppendLine(description);

        return string.Format("{0}&lt;table&gt;&lt;tr&gt;&lt;td style=\"width:400px; vertical-align:top\"&gt;{1}&lt;/td&gt;&lt;td style=\"width:400px; vertical-align:top\"&gt;{2}&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;", top, metadata.ToString(), image);
    }

 private string B()
    {
        string title = GetTitle();
        string mediaType = GetMediaType();
        string description = GetDescription();
        string releaseDate = GetReleaseDate();
        string contributors = GetContributors();
        string image = GetImage();
        string genres = GetGenres();
        string ratings = GetRatings();

        string top = string.Format("{0}This is a {1}{2}.&lt;br&gt;&lt;br&gt;",
                title, mediaType, string.IsNullOrEmpty(releaseDate) ? string.Empty
                : " released in " + releaseDate);

        StringBuilder metadata = new StringBuilder();
        metadata.AppendLine(contributors + "&lt;br&gt;");
        metadata.AppendLine(genres + "&lt;br&gt;&lt;br&gt;");
        metadata.AppendLine(ratings + "&lt;br&gt;&lt;br&gt;");
        metadata.AppendLine(description);

        return string.Format("{0}&lt;table&gt;&lt;tr&gt;&lt;td style=\"width:400px; vertical-align:top\"&gt;{1}&lt;/td&gt;&lt;td style=\"width:400px; vertical-align:top\"&gt;{2}&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;", top, metadata.ToString(), image);
    }
A good practice is Observe which part of the code does not change Extract that keep it in a separate method.  Pass the variable Which changes as an input to that method.

    public string CommonMethod(string formattedString)
    {
        string title = GetTitle();
        string mediaType = GetMediaType();
        string description = GetDescription();
        /***string releaseYear = GetReleaseYear();***/ this is not required.
        string contributors = GetContributors();
        string image = GetImage();
        string genres = GetGenres();
        string ratings = GetRatings();

        string top = **formattedString**;

        StringBuilder metadata = new StringBuilder();
        metadata.AppendLine(contributors + "&lt;br&gt;");
        metadata.AppendLine(genres + "&lt;br&gt;&lt;br&gt;");
        metadata.AppendLine(ratings + "&lt;br&gt;&lt;br&gt;");
        metadata.AppendLine(description);

        return string.Format("{0}&lt;table&gt;&lt;tr&gt;&lt;td style=\"width:400px; vertical-align:top\"&gt;{1}&lt;/td&gt;&lt;td style=\"width:400px; vertical-align:top\"&gt;{2}&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;", top, metadata.ToString(), image);
    }


each time the difference might be on a different line or couple of lines.

This part is difficult to answer. Even in that scenario, omit the one or two lines which may change, pass the things which may change as input.